JP2014006871A - Image region dividing device, method, and program - Google Patents

Image region dividing device, method, and program Download PDF

Info

Publication number
JP2014006871A
JP2014006871A JP2012261884A JP2012261884A JP2014006871A JP 2014006871 A JP2014006871 A JP 2014006871A JP 2012261884 A JP2012261884 A JP 2012261884A JP 2012261884 A JP2012261884 A JP 2012261884A JP 2014006871 A JP2014006871 A JP 2014006871A
Authority
JP
Japan
Prior art keywords
image
main subject
pixel
circular object
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.)
Granted
Application number
JP2012261884A
Other languages
Japanese (ja)
Other versions
JP5786838B2 (en
Inventor
Kazuhisa Matsunaga
和久 松永
Masayuki Hirohama
雅行 広浜
Koichi Nakagome
浩一 中込
Michio Nihei
道大 二瓶
Keiichi Kobayashi
圭一 小林
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.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co 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 Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP2012261884A priority Critical patent/JP5786838B2/en
Publication of JP2014006871A publication Critical patent/JP2014006871A/en
Application granted granted Critical
Publication of JP5786838B2 publication Critical patent/JP5786838B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To improve cut-out accuracy of a principal subject by excluding influences of edges independent of a cut-out target in a radial direction from the center of the principal subject in a case that the principal subject within an image range designated in an image is circular.SOLUTION: Circular object determination means 201 determines whether a principal subject is circular or not. When the principal subject is determined to be circular, edge emphasis control means 202 performs processing of emphasizing edges in a direction orthogonal to a radial line connecting the center of an image region and a target pixel, for each target pixel within an image range, and then outputs the target pixel. When the principal subject is determined to be not circular, the edge emphasis control means outputs the target pixel as it is. Region division means 203 divides a region of the principal subject and a region of a background within an image in which edge emphasis control is performed for each target pixel. Thus region division accuracy is improved when the principal subject is circular.

Description

本発明は、画像内で指定された画像範囲内の主要被写体とそれ以外の背景を領域分割する装置、方法、およびプログラムに関する。   The present invention relates to an apparatus, a method, and a program for dividing a main subject in an image range designated in an image and other backgrounds into regions.

野山や道端で見かけた花の名前を知りたくなることがある。そこで、撮影等により得た花のディジタル画像より、クラスタリング法を用いて対象物である花の画像を抽出し、その抽出された花の画像より得られる情報を特徴量とする。単数または複数の特徴量を求め、その求められた特徴量と、あらかじめデータベースに登録してある各種の植物の特徴量とを統計的手法を用いて解析して野草の種類を判別する技術が提案されている(例えば特許文献1に記載の技術)。
また、主要被写体を含む画像をGraph Cuts法を用いて主要被写体領域と背景領域とに分割する従来技術が知られている(例えば非特許文献1、特許文献2に記載の技術)。領域分割を行う場合,主要被写体他と背景の関係によりその境界が不明確な部分が存在する可能性があり,最適な領域分割を行う必要がある。そこで、この従来技術では、領域分割をエネルギーの最小化問題としてとらえ、その最小化手法を提案している。この従来技術では,領域分割に適合するようにグラフを作成し、そのグラフの最小カットを求めることにより、エネルギー関数の最小化を行う。この最小カットは、最大フローアルゴリズムを用いることにより、効率的な領域分割計算を実現している。
Sometimes you want to know the name of a flower you saw on Noyama or a roadside. Therefore, a flower image as an object is extracted from a digital flower image obtained by photographing or the like using a clustering method, and information obtained from the extracted flower image is used as a feature amount. Proposed a technique to determine the type of wild grass by calculating one or more feature quantities and analyzing the obtained feature quantities and the feature quantities of various plants registered in the database in advance using statistical methods. (For example, the technique described in Patent Document 1).
In addition, a conventional technique is known in which an image including a main subject is divided into a main subject area and a background area using the Graph Cuts method (for example, techniques described in Non-Patent Document 1 and Patent Document 2). When region segmentation is performed, there may be a portion where the boundary is unclear due to the relationship between the main subject and others and the background, and it is necessary to perform segmentation optimally. Therefore, in this prior art, region division is regarded as an energy minimization problem, and a minimization method is proposed. In this prior art, the energy function is minimized by creating a graph that matches the region division and obtaining the minimum cut of the graph. This minimum cut realizes efficient area division calculation by using a maximum flow algorithm.

特開2002−203242号公報Japanese Patent Laid-Open No. 2002-203242 特開2011−35636号公報JP 2011-35636 A

Y.Boykov and G.Funka−Lea:“Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in N−D Images”,Proceedings of “Internation Conference on Computer Vision”,Vancouver,Canada,vol.I,p.105−112,July 2001.Y. Boykov and G. Funka-Lea: “Interactive Graph Cuts for Optimal Boundary & Region Segmentation of Objects in ND Images”, Proceedings of “Interference Convence CV”. I, p. 105-112, July 2001.

しかし、花などの同心円形状の画像を、背景領域から分割して切抜きを行う際、花の外側の背景部分に種々のパターンのエッジが存在し、背景領域を誤認しやすく、切り抜き精度が低下しやすいという問題点を有していた。
本発明は、主要被写体が円形物である場合に、主要被写体の中心から放射する方向の、切り抜き対象とは無関係のエッジの影響を排除して、主要被写体の切り抜き精度を上げることを目的とする。
However, when concentric images such as flowers are cut out from the background area, various pattern edges exist in the background part outside the flower, making it easy to misidentify the background area and reducing the cutting accuracy. It had the problem of being easy.
An object of the present invention is to improve the clipping accuracy of a main subject by eliminating the influence of an edge unrelated to the clipping target in the direction radiating from the center of the main subject when the main subject is a circular object. .

態様の一例では、画像内で指定された画像範囲内の主要被写体とその主要被写体以外の背景を領域分割する装置であって、主要被写体が円形物であるか否かを判定する円形物判定手段と、画像範囲内の注目画素ごとに、主要被写体が円形物であると判定された場合に、画像範囲内の中央とその注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行ってその注目画素を出力し、主要被写体が円形物ではないと判定された場合に、その注目画素をそのまま出力するエッジ強調制御手段と、注目画素ごとにエッジ強調の制御を行った画像内で主要被写体と背景を領域分割する領域分割手段とを備える。   In an example of the aspect, a circular object determination unit that divides a main subject within an image range designated in an image and a background other than the main subject into regions and determines whether the main subject is a circular object or not. When the main subject is determined to be a circular object for each target pixel in the image range, processing for enhancing an edge in a direction orthogonal to the radiation connecting the center in the image range and the target pixel is performed. Output the pixel of interest, and if it is determined that the main subject is not a circular object, the edge enhancement control means for outputting the pixel of interest as it is, and an image in which edge enhancement is controlled for each pixel of interest An area dividing means for dividing the main subject and the background into areas is provided.

本発明によれば、主要被写体が円形物である場合に、主要被写体領域の中心から放射する方向の、切り抜き対象とは無関係のエッジの影響を排除して、主要被写体の切り抜き精度を上げることが可能となる。   According to the present invention, when the main subject is a circular object, it is possible to improve the clipping accuracy of the main subject by eliminating the influence of the edge irradiating from the center of the main subject area and irrelevant to the clipping target. It becomes possible.

本発明の一実施形態に係る画像領域分割装置のハードウェア構成例を示すブロック図である。It is a block diagram which shows the hardware structural example of the image area division | segmentation apparatus which concerns on one Embodiment of this invention. 図1の画像領域分割装置の機能ブロック図である。FIG. 2 is a functional block diagram of the image region dividing device in FIG. 1. 本実施形態の説明図である。It is explanatory drawing of this embodiment. 本実施形態による画像領域分割処理の全体動作を示すフローチャートである。It is a flowchart which shows the whole operation | movement of the image area division | segmentation process by this embodiment. 円形物判定処理の第1の実施形態を示すフローチャートである。It is a flowchart which shows 1st Embodiment of a circular object determination process. 円形物判定処理の第1の実施形態の説明図である。It is explanatory drawing of 1st Embodiment of a circular object determination process. 円形物判定処理の第2の実施形態を示すフローチャートである。It is a flowchart which shows 2nd Embodiment of a circular object determination process. 円形物判定処理の第2の実施形態の説明図である。It is explanatory drawing of 2nd Embodiment of a circular object determination process. ゲイン算出処理の説明図である。It is explanatory drawing of a gain calculation process. 同心円強調フィルタ生成処理を示すフローチャートである。It is a flowchart which shows a concentric circle emphasis filter production | generation process. 重み付き有向グラフの説明図である。It is explanatory drawing of a weighted directed graph. ヒストグラムθの説明図である。It is explanatory drawing of histogram (theta). uv(Xu ,Xv )の特性図である。It is a characteristic view of h uv (X u , X v ). t−linkとn−linkを有するグラフと、領域ラベルベクトルXおよびグラフカットとの関係を、模式的に示した図である。It is the figure which showed typically the relationship between the graph which has t-link and n-link, the area | region label vector X, and the graph cut. 領域分割処理を示すフローチャートである。It is a flowchart which shows an area | region division process.

以下、本発明を実施するための形態について図面を参照しながら詳細に説明する。   Hereinafter, embodiments for carrying out the present invention will be described in detail with reference to the drawings.

図1は、本発明の一実施形態に係る画像領域分割装置101のハードウェア構成例を示すブロック図である。   FIG. 1 is a block diagram illustrating a hardware configuration example of an image area dividing device 101 according to an embodiment of the present invention.

この画像識別器生成装置101は例えば、いわゆるスマートフォンなどの携帯情報端末であるコンピュータシステム上に実現される。   The image discriminator generation device 101 is realized on a computer system that is a portable information terminal such as a so-called smartphone.

画像領域分割装置101は、CPU(Central Processing Unit:中央演算処理装置)102と、ROM(Read Only Memory)103と、RAM(Random Access Memory)104を備える。また、画像領域分割装置101は、ソリッド記憶装置等の外部記憶装置105と、通信インタフェース106と、タッチパネルディスプレイ装置などの入力装置107および表示装置108を備える。さらに、画像領域分割装置101は、マイクロSDメモリカードやUSB(Universal Serial Bus)メモリカードなどの可搬記録媒体110をセット可能な可搬記録媒体駆動装置109を備える。撮像装置112は、静止画像やビデオ画像を撮像することのできるデジタルカメラ機構であり、レンズ、オートフォーカス駆動制御装置、露出制御装置、撮像センサ等を備える。上述の各機器102〜109および112は、バス111によって相互に接続される。   The image area dividing device 101 includes a CPU (Central Processing Unit) 102, a ROM (Read Only Memory) 103, and a RAM (Random Access Memory) 104. The image area dividing device 101 includes an external storage device 105 such as a solid storage device, a communication interface 106, an input device 107 such as a touch panel display device, and a display device 108. Further, the image area dividing device 101 includes a portable recording medium driving device 109 capable of setting a portable recording medium 110 such as a micro SD memory card or a USB (Universal Serial Bus) memory card. The imaging device 112 is a digital camera mechanism that can capture still images and video images, and includes a lens, an autofocus drive control device, an exposure control device, an imaging sensor, and the like. The above-described devices 102 to 109 and 112 are connected to each other by a bus 111.

ROM103には、スマートフォン全体の一般的な動作を制御するプログラムのほか、後述する図4、図5、図7、図10、および図15のフローチャートによって示される画像領域分割処理の制御プログラムが記憶されている。CPU102は、ROM103から、この制御プログラムを読み出し、RAM104をワークメモリとして実行する。これにより、後述する図2の機能ブロックで示される画像領域分割機能が実現され、この結果、例えばユーザが、撮像装置112によって花などを撮像し、入力装置107で範囲してした画像範囲から、花などの主要被写体をそれ以外の背景から分割する画像領域分割処理が実行される。これにより得られた花などの主要被写体領域の画像データは、ユーザが例えば花の種類を検索するために、通信インタフェース106から特には図示しないインターネットを経由してインターネットに接続される画像検索サーバコンピュータに送信される。このコンピュータ上で、送られた主要被写体領域の花画像データに基づいて花のデータベースが検索される。その結果検索がヒットした花の図鑑情報が、その花の画像データとともにインターネットを経由して通信インタフェース106にて受信され、表示装置108に表示される。   The ROM 103 stores a program for controlling general operations of the entire smartphone, and a control program for image region division processing shown by flowcharts of FIGS. 4, 5, 7, 10, and 15 described later. ing. The CPU 102 reads this control program from the ROM 103 and executes the RAM 104 as a work memory. Thereby, an image region dividing function shown in the functional block of FIG. 2 to be described later is realized. As a result, for example, the user images a flower or the like by the imaging device 112 and An image region dividing process for dividing a main subject such as a flower from other backgrounds is executed. The image data of the main subject area such as a flower thus obtained is used as an image search server computer connected to the Internet from the communication interface 106 via the Internet (not shown), in particular, in order for the user to search for, for example, the type of flower. Sent to. On this computer, a flower database is searched based on the sent flower image data of the main subject area. As a result, the pictorial book information of the flower hit by the search is received by the communication interface 106 together with the image data of the flower via the Internet and displayed on the display device 108.

なお、本実施形態による画像領域分割装置101は、携帯情報端末上ではなく、上記サーバコンピュータ上などに実現されてもよい。   Note that the image region dividing device 101 according to the present embodiment may be realized not on the portable information terminal but on the server computer.

図2は、図1の画像領域分割装置101の機能ブロック図である。   FIG. 2 is a functional block diagram of the image area dividing device 101 of FIG.

本実施形態における画像領域分割装置101は、画像内で例えばユーザによって矩形指定された画像範囲内で、花などの主要被写体とその主要被写体以外の背景を領域分割する装置として実現される。   The image area dividing device 101 according to the present embodiment is realized as an apparatus that divides a main subject such as a flower and a background other than the main subject into an area within an image range designated by a user, for example, as a rectangle.

円形物判定手段201は、主要被写体が円形物であるか否かを判定する。具体的には、この円形物判定手段201は、例えば画像内で主要被写体と背景を事前に領域分割する。次に、円形物判定手段201は、事前に領域分割された主要被写体が例えば矩形指定された画像範囲の境界線に接する率が第1の所定値に比較して小さいか否かを判定する。さらに、円形物判定手段201は、その接する率が第1の所定値に比較して小さいと判定された場合に、例えば矩形指定された画像範囲に内接する円の内側の領域をその円の中心とその円の円周上の複数の点とをそれぞれ結ぶ複数の線分によって複数の領域に分割し、それら複数の領域ごとに主要被写体に属する画素の数を計数する。そして、円形物判定手段201は、それら複数の領域ごとの計数の結果の最大値と最小値の差が第2の所定値に比較して小さい場合に、主要被写体が円形物であると判定する。あるいは、円形物判定手段201は、例えば矩形指定された画像範囲に内接する円内で支配的な色の分布状況が円形状であるか否かを判定することにより、主要被写体が円形物であるか否かを判定する。この場合、円形物判定手段201は、例えば矩形指定された画像範囲に内接する円の領域に属する画素値をサンプリングし、そのサンプリングされた画素値を2つのクラスタにクラスタリングし、そのクラスタリングされた大きい方のクラスタに属する画素を支配的な色に属する画素とする。そして、円形物判定手段201は、その支配的な色に属する画素について、画像上の分布の主成分分析を行い、その主成分分析で抽出された第1主成分の寄与率が例えば50から60%程度の範囲に入るときに、主要被写体が円形物であると判定する。ここで、寄与率とは、主成分分析における分散共分散行列の全ての固有値の和に対する第1固有値の割合を示す。   The circular object determination unit 201 determines whether or not the main subject is a circular object. Specifically, the circular object determination unit 201 divides a main subject and a background in advance in an image, for example. Next, the circular object determination unit 201 determines whether or not the ratio of the main subject that has been divided into regions in advance to the boundary line of the image range designated by, for example, the rectangle is smaller than the first predetermined value. Further, when it is determined that the contact ratio is smaller than the first predetermined value, the circular object determination unit 201 determines, for example, a region inside the circle inscribed in the rectangular designated image range as the center of the circle. Are divided into a plurality of regions by a plurality of line segments respectively connecting the circle and a plurality of points on the circumference of the circle, and the number of pixels belonging to the main subject is counted for each of the plurality of regions. Then, the circular object determination unit 201 determines that the main subject is a circular object when the difference between the maximum value and the minimum value of the count results for each of the plurality of areas is smaller than the second predetermined value. . Alternatively, the circular object determination unit 201 determines whether the dominant color distribution state in a circle inscribed in the rectangular image range is circular, for example, so that the main subject is a circular object. It is determined whether or not. In this case, the circular object determination unit 201 samples pixel values belonging to a circle area inscribed in, for example, a rectangular designated image range, clusters the sampled pixel values into two clusters, and the clustered large Pixels belonging to one cluster are assumed to belong to dominant colors. Then, the circular object determination unit 201 performs principal component analysis of the distribution on the image for the pixels belonging to the dominant color, and the contribution ratio of the first principal component extracted by the principal component analysis is, for example, 50 to 60 When entering the range of about%, it is determined that the main subject is a circular object. Here, the contribution rate indicates the ratio of the first eigenvalue to the sum of all eigenvalues of the variance-covariance matrix in the principal component analysis.

エッジ強調制御手段202は、円形物判定手段201によって主要被写体が円形物であると判定された場合に、画像範囲内の注目画素ごとに、画像範囲内の中央とその注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行ってその注目画素を出力する。また、エッジ強調制御手段202は、円形物判定手段201によって主要被写体が円形物ではないと判定された場合に、その注目画素をそのまま出力する。具体的には、エッジ強調制御手段202は、円形物判定手段201によって主要被写体が円形物であると判定された場合に、次の処理を実行する。まず、エッジ強調制御手段202は、例えばユーザによって矩形指定された画像範囲内の注目画素ごとに、画像範囲内の中央とその注目画素を結ぶ放射線に対してエッジ強調の微分演算を行う方向がなす角度に応じたゲインを算出する。より具体的には、このゲイン算出手段201は例えば、ゲインを、角度の余弦値の絶対値を1から減算して得た値に基づいて決定する。そして、エッジ強調制御手段202は、上記注目画素ごとに、エッジ強調の微分演算を行い、その微分演算の結果に、ゲイン算出手段201にてその微分演算を行う方向がなす角度に応じて算出されているゲインにより重み付けを行い、その重み付けがされた微分演算の結果に基づいて、注目画素に対してエッジを強調する処理を行って注目画素を出力する。   When the circular object determining unit 201 determines that the main subject is a circular object, the edge enhancement control unit 202 applies, for each target pixel in the image range, the radiation connecting the center in the image range and the target pixel. Then, processing for emphasizing edges in the orthogonal direction is performed, and the target pixel is output. Further, when the circular object determination unit 201 determines that the main subject is not a circular object, the edge enhancement control unit 202 outputs the target pixel as it is. Specifically, the edge enhancement control unit 202 executes the following process when the circular object determination unit 201 determines that the main subject is a circular object. First, for example, for each target pixel in the image range designated by the user as a rectangle, the edge emphasis control unit 202 has a direction in which an edge emphasis differential operation is performed on the radiation connecting the center of the image range and the target pixel. The gain corresponding to the angle is calculated. More specifically, the gain calculating unit 201 determines the gain based on a value obtained by subtracting the absolute value of the cosine value of the angle from 1, for example. Then, the edge enhancement control unit 202 performs an edge enhancement differentiation operation for each pixel of interest, and is calculated according to an angle formed by the direction in which the gain calculation unit 201 performs the differentiation operation as a result of the differentiation operation. The weighting is performed by the gain, and the process of emphasizing the edge is performed on the target pixel based on the weighted differential calculation result, and the target pixel is output.

領域分割手段203は、注目画素ごとにエッジ強調の制御を行った画像内で主要被写体と背景を領域分割する。具体的には、領域分割手段203は、注目画素ごとにエッジ強調制御手段202にてエッジ強調の制御を行った画像範囲内の各画素に付与する主要被写体または背景を示す領域ラベル値を更新しながら、その領域ラベル値とエッジ強調の制御を行った画素値とに基づいて、主要被写体らしさまたは背景らしさと隣接画素間の画素値の変化を評価するエネルギー関数を定義し、その関数の最小化処理により画像内で主要被写体と前記背景を領域分割する。この領域分割手段203は例えば、Graph Cuts法によりエネルギー関数の最小化処理を実行する。   The area dividing unit 203 divides the main subject and the background into areas in the image in which edge enhancement is controlled for each target pixel. Specifically, the region dividing unit 203 updates the region label value indicating the main subject or the background to be given to each pixel in the image range in which the edge enhancement control is performed by the edge enhancement control unit 202 for each target pixel. However, based on the region label value and the pixel value for which edge enhancement is controlled, an energy function that evaluates the change of the pixel value between the main subject or background and adjacent pixels is defined, and the function is minimized. The main subject and the background are divided into regions in the image by processing. The area dividing unit 203 executes, for example, energy function minimization processing by the Graph Cuts method.

図2に示される本実施形態における画像領域分割装置101の機能構成により、主要被写体が花などの同心円形状の画像の切り抜きを行う際、花の外側の背景部分に種々のパターンのエッジが存在し、背景領域を誤認しやすい場合でも、円形物判定手段201により主要被写体が円形物であると判定され、その判定に基づいてエッジ強調制御手段202が、同心円のエッジを強調するフィルタ処理を実行することができる。この場合、エッジ強調制御手段202がエッジ強調処理を実行する際に、花の中心から放射する方向の切り抜き対象とは無関係のエッジ強調を弱め、逆に放射線と直交する同心円方向のエッジをより強調する処理を行う。この結果、その後に実行される領域分割手段203における領域分割処理において、背景領域を主要被写体領域と誤認識する等の割合が減少し、主要被写体領域と背景領域のエッジ境界部分における切り抜き精度を向上させることが可能となる。   With the functional configuration of the image region dividing device 101 in the present embodiment shown in FIG. 2, when the main subject cuts out a concentric image such as a flower, edges of various patterns exist in the background portion outside the flower. Even when the background region is likely to be misidentified, the circular object determining unit 201 determines that the main subject is a circular object, and based on the determination, the edge enhancement control unit 202 executes filter processing for enhancing the edges of the concentric circles. be able to. In this case, when the edge emphasis control unit 202 executes the edge emphasis process, the edge emphasis unrelated to the clipping target in the direction radiating from the center of the flower is weakened, and concentric edges perpendicular to the radiation are more emphasized. Perform the process. As a result, the ratio of erroneous recognition of the background area as the main subject area is reduced in the area division processing performed by the area dividing unit 203 thereafter, and the cutout accuracy at the edge boundary portion between the main subject area and the background area is improved. It becomes possible to make it.

例えば、図3のような花の画像の例において、301の部分ではエッジを強調し、302の部分では誤抽出を防ぐためにエッジを平滑化したい。このような場合に、本実施形態では、花の中心から同心円状に存在するエッジ301の部分をより強調し、エッジ302の部分は強調を弱めることができるため、例えば花の下の茎の部分を誤抽出するようなことを防ぐことが可能となる。   For example, in the example of the flower image as shown in FIG. 3, it is desired to emphasize the edge in the portion 301 and smooth the edge in the portion 302 in order to prevent erroneous extraction. In such a case, in the present embodiment, the portion of the edge 301 that exists concentrically from the center of the flower can be more emphasized, and the portion of the edge 302 can be less emphasized. Can be prevented from being erroneously extracted.

また、本実施形態では、主要被写体が円形物でない花や群生する花などの場合には、円形物判定手段201が主要被写体が円形物ではないと判定することにより、エッジ強調制御手段202によって不要なエッジ強調が行われないようにして、領域分割手段203における領域分割処理の精度を維持することが可能となる。   In the present embodiment, when the main subject is a flower that is not a circular object or a clustered flower, the circular object determination unit 201 determines that the main object is not a circular object, so that the edge enhancement control unit 202 does not need it. Thus, it is possible to maintain the accuracy of the region dividing process in the region dividing unit 203 without performing the edge enhancement.

図4は、本実施形態による画像領域分割処理の全体動作を示すフローチャートである。このフローチャートの処理は、図5、図7、図10および図15の詳細処理を示すフローチャートの処理とともに、図1のCPU102が、ROM103に記憶された制御プログラムを、RAM104をワークメモリとして使用しながら実行する処理として実現される。   FIG. 4 is a flowchart showing the overall operation of the image area dividing process according to the present embodiment. The processing of this flowchart is performed while the control program stored in the ROM 103 is used as the work memory by the CPU 102 of FIG. 1 together with the processing of the flowchart showing the detailed processing of FIG. 5, FIG. 7, FIG. 10, and FIG. This is realized as a process to be executed.

まず、矩形枠決定処理が実行される(図4のステップS401)。この処理では、ユーザが、例えば図1の撮像装置112にて撮像した画像に対して、認識したい物体(例えば花)が存在するおおよその領域に対して、例えばタッチパネル等の入力装置107を用いて、矩形枠を指定する。例えば、タッチパネル上での、いわゆる指によるピンチ動作である。   First, rectangular frame determination processing is executed (step S401 in FIG. 4). In this process, the user uses, for example, the input device 107 such as a touch panel for an approximate region where an object (for example, a flower) to be recognized exists in an image captured by the imaging device 112 of FIG. Specify a rectangular frame. For example, a so-called finger pinch operation on the touch panel.

次に、円形物判定処理が実行される(図4のステップS402)。この処理は、図2の円形物判定手段201の機能を実現する。この処理の詳細は、図5〜図8で後述する。
ステップS402での円形物判定処理の結果、主要被写体が円形物であるか否かが判定される(図4のステップS403)。主要被写体が円形物であってステップS403の判定がYESならば、同心円エッジ強調フィルタ生成処理が実行される(図4のステップS404)。この処理では、同心円方向のエッジを強調するフィルタが適用される。この処理の詳細は、図9、図10で後述する。主要被写体が円形物であってステップS403の判定がNOならば、ステップS404の同心円エッジ強調フィルタ生成処理はスキップされる。ステップS403とS404の処理は、図2のエッジ強調制御手段202の機能を実現する。
Next, a circular object determination process is executed (step S402 in FIG. 4). This process realizes the function of the circular object determining means 201 in FIG. Details of this processing will be described later with reference to FIGS.
As a result of the circular object determination process in step S402, it is determined whether or not the main subject is a circular object (step S403 in FIG. 4). If the main subject is a circular object and the determination in step S403 is YES, concentric edge enhancement filter generation processing is executed (step S404 in FIG. 4). In this processing, a filter that emphasizes concentric edges is applied. Details of this processing will be described later with reference to FIGS. If the main subject is a circular object and the determination in step S403 is NO, the concentric edge enhancement filter generation process in step S404 is skipped. The processing in steps S403 and S404 realizes the function of the edge enhancement control unit 202 in FIG.

ステップS404の後またはステップS403の判定がNOとなった後、画像範囲内の各画素に対して、主要被写体と前記背景を領域分割する領域分割処理が実行される(図4のステップS405)。この処理は、図2の領域分割手段203の機能を実現する。この処理については、図11〜図15で後述する。   After step S404 or after the determination in step S403 is NO, an area division process for dividing the main subject and the background into areas is executed for each pixel in the image range (step S405 in FIG. 4). This process realizes the function of the area dividing unit 203 in FIG. This process will be described later with reference to FIGS.

一度領域分割処理が終了した後、収束判定が行われる(図4のステップS406)。この収束判定は、以下のいずれかが満たされたときに、YESの判定結果となる。
・繰り返し回数が一定以上になった
・前回前景とされた領域面積と今回前景とされた領域の差が一定以下
Once the region division processing is completed, convergence determination is performed (step S406 in FIG. 4). This convergence determination is a determination result of YES when any of the following is satisfied.
・ The number of repetitions has exceeded a certain level ・ The difference between the area that was the previous foreground and the area that was the foreground this time is less than a certain level

ステップS406の判定で収束せず、その判定がNOであった場合、前回のグラフカット処理の状況に応じて、ユーザが指定した矩形枠内の後述するコスト関数gv (Xv )が、次のようにして修正されてデータ更新される(図4のステップS407)。ステップS405のグラフカット処理によって主要被写体と判定された領域のヒストグラムと、事前に用意されている後述するヒストグラムθ(c,0)が、カラー画素値cごとに混合(加算)される。これにより、新たな主要被写体らしさを示すヒストグラムθ(c,0)が生成され、それに基づいて新たなコスト関数gv (Xv )が計算される(後述する数6、9、10式等を参照)。 If the determination in step S406 does not converge and the determination is NO, the cost function g v (X v ) described later in the rectangular frame designated by the user is Thus, the data is updated after being corrected (step S407 in FIG. 4). The histogram of the area determined as the main subject by the graph cut processing in step S405 and a histogram θ (c, 0) described later prepared in advance are mixed (added) for each color pixel value c. As a result, a new histogram θ (c, 0) indicating the likelihood of the main subject is generated, and a new cost function g v (X v ) is calculated based on the histogram θ (c, 0) (Equations 6, 9, 10, etc., which will be described later). reference).

ステップS406の判定が収束し、その判定がYESになると、図4のフローチャートで示される領域分割処理は終了とし、現在得られている主要被写体領域が最終結果として出力される。   When the determination in step S406 is converged and the determination is YES, the region division process shown in the flowchart of FIG. 4 is terminated, and the main subject region currently obtained is output as the final result.

図4のステップS402の円形物判定処理の詳細について、以下に説明する。   Details of the circular object determination process in step S402 of FIG. 4 will be described below.

図5および図6は、図4のステップS402の円形物判定処理の第1の実施形態を示すフローチャートおよびその説明図である。   FIGS. 5 and 6 are a flowchart and an explanatory diagram showing the first embodiment of the circular object determination process in step S402 of FIG.

まず、例えば入力されている画像内のユーザによって例えば矩形指定された画像範囲内で、主要被写体と背景が事前に領域分割される(図5のステップS501)。領域分割のアルゴリズムとしては、例えば図4のステップS405と同様の後述するGraph Cuts法を採用することができる。この領域分割の結果、例えば図6(a)に示される矩形の画像範囲601内で、主要被写体である花の領域602とその周囲の領域603が事前におおかまに領域分割される。   First, the main subject and the background are divided into areas in advance, for example, within an image range designated by the user in the input image, for example (step S501 in FIG. 5). As an area division algorithm, for example, the later-described Graph Cuts method similar to step S405 in FIG. 4 can be employed. As a result of this region division, for example, within the rectangular image range 601 shown in FIG. 6A, the flower region 602 as the main subject and the surrounding region 603 are roughly divided in advance.

次に、事前に領域分割された主要被写体が例えば矩形指定された画像範囲の境界線に接する率(接着率)が一定値以下(第1の所定値に比較して小さい)か否かが判定される(図5のステップS502)。   Next, it is determined whether or not the ratio (adhesion rate) at which the main subject divided in advance is in contact with the boundary line of the image area designated by the rectangle is smaller than a predetermined value (smaller than the first predetermined value). (Step S502 in FIG. 5).

接着率が一定値以下と判定されステップS502の判定がYESの場合、例えば矩形指定された画像範囲に内接する円の内側の領域が、その円の中心とその円の円周上の例えば8個の複数の点とをそれぞれ結ぶ例えば8本の複数の線分によって、例えば図6(b)の8つの領域604(#1)〜604(#8)として示される複数の領域に分割される。そして、これらの複数の領域ごとに、主要被写体に属する画素の数が計数され、例えば図6(c)の8つのビン値605(#1)〜605(#8)として示されるヒストグラムが作成される(以上、図5のステップS503)。   If the adhesion rate is determined to be equal to or less than a predetermined value and the determination in step S502 is YES, for example, there are, for example, eight regions on the inner side of the circle inscribed in the image area designated by the rectangle and the circumference of the circle. For example, by dividing a plurality of points into a plurality of points, for example, a plurality of regions are divided into a plurality of regions shown as, for example, eight regions 604 (# 1) to 604 (# 8) in FIG. Then, the number of pixels belonging to the main subject is counted for each of the plurality of regions, and for example, histograms shown as eight bin values 605 (# 1) to 605 (# 8) in FIG. 6C are created. (Step S503 in FIG. 5).

そして、ステップS503で作成されたヒストグラム中の例えば図6(c)の8つのビン値605(#1)〜605(#8)のうち、最大値と最小値の差分が算出され、その差分が一定値以内(第2の所定値に比較して小さい)か否かが判定される(図5のステップS504)。   Then, for example, among the eight bin values 605 (# 1) to 605 (# 8) in FIG. 6C in the histogram created in step S503, the difference between the maximum value and the minimum value is calculated, and the difference is calculated. It is determined whether or not it is within a certain value (smaller than the second predetermined value) (step S504 in FIG. 5).

この結果、ステップS504の判定がYESの場合に、入力された画像中の主要被写体は円形物であると判定される(図5のステップS505)。   As a result, when the determination in step S504 is YES, it is determined that the main subject in the input image is a circular object (step S505 in FIG. 5).

接着率が一定値以下ではないと判定されステップS502の判定がNOの場合、またはヒストグラム中の最大値と最小値の差分が一定値以内ではなくステップS504の判定がNOの場合には、入力された画像中の主要被写体は円形物ではないと判定される(図5のステップS506)。   If the adhesion rate is determined not to be less than a certain value and the determination in step S502 is NO, or if the difference between the maximum value and the minimum value in the histogram is not within a certain value and the determination in step S504 is NO, it is input. It is determined that the main subject in the image is not a circular object (step S506 in FIG. 5).

以上の図5および図6で説明した円形物判定処理の第1の実施形態により、例えば矩形指定された画像範囲の内接円中で、放射状に広がる複数の領域604(#1)〜604(#8)に、主要被写体の画素がほぼ均一して分布しているか否かを判定することにより、画像範囲中の主要被写体が円形物であるか否かを判定することが可能となる。   According to the first embodiment of the circular object determination process described above with reference to FIGS. 5 and 6, for example, a plurality of regions 604 (# 1) to 604 (# 1) to 604 (# 1) that extend radially in an inscribed circle of an image range designated by a rectangle In # 8), it is possible to determine whether or not the main subject in the image range is a circular object by determining whether or not the pixels of the main subject are almost uniformly distributed.

図7および図8は、図4のステップS402の円形物判定処理の第2の実施形態を示すフローチャートおよびその説明図である。   7 and 8 are a flowchart and an explanatory diagram showing a second embodiment of the circular object determination process in step S402 of FIG.

まず、例えば入力されている画像内のユーザによって例えば矩形指定された画像範囲に内接する円の領域に属する画素値(例えばRGB値)がサンプリングされる(図7のステップS701)。例えば、図8(a)に示される矩形の画像範囲801に内接する内接円802の領域内の画素値がサンプリングされる。   First, for example, pixel values (for example, RGB values) belonging to a circle area inscribed in a rectangular image range, for example, are sampled by the user in the input image (step S701 in FIG. 7). For example, pixel values in the area of the inscribed circle 802 inscribed in the rectangular image range 801 shown in FIG. 8A are sampled.

次に、ステップS701でサンプリングされた画素値が、例えばRGBの色空間上で2つのクラスタにクラスタリングされる。クラスタリングの手法としては、例えばk−means法を採用することができる。そして、クラスタリングされた大きい方のクラスタに属する画素が支配色(支配的な色)に属する画素とされる(以上、図7のステップS702)。   Next, the pixel values sampled in step S701 are clustered into, for example, two clusters on the RGB color space. As a clustering method, for example, a k-means method can be employed. Then, the pixels belonging to the clustered larger cluster are the pixels belonging to the dominant color (dominant color) (step S702 in FIG. 7).

さらに、上述の支配色に属する画素が画像の内接円802の領域上にプロットされ、そのプロットの分布の主成分分析が実行される(図7のステップS703)。この結果、例えば図8(b)に示されるように、画像上の内接円802の領域内の複数の黒丸で示されるプロットに対して主成分分析が実行され、例えば第1主成分803、第2主成分804が算出される。   Further, the pixels belonging to the dominant color are plotted on the area of the inscribed circle 802 of the image, and the principal component analysis of the distribution of the plot is executed (step S703 in FIG. 7). As a result, as shown in FIG. 8B, for example, a principal component analysis is performed on a plot indicated by a plurality of black circles in the region of the inscribed circle 802 on the image, for example, the first principal component 803, A second principal component 804 is calculated.

そして、ステップS703での主成分分析で抽出された第1主成分の寄与率が例えば50から60%程度の範囲に入るか否かが判定される(図7のステップS704)。   Then, it is determined whether or not the contribution ratio of the first principal component extracted by the principal component analysis in step S703 falls within a range of, for example, about 50 to 60% (step S704 in FIG. 7).

第1主成分の寄与率が例えば50から60%程度の範囲に入りステップS704の判定がYESならば、主要被写体は円形物であると判定される(図7のステップS705)。   If the contribution ratio of the first principal component falls within a range of about 50 to 60%, for example, and the determination in step S704 is YES, it is determined that the main subject is a circular object (step S705 in FIG. 7).

第1主成分の寄与率が例えば50から60%程度の範囲に入らずステップS704の判定がNOならば、主要被写体は円形物ではないと判定される(図7のステップS706)。   If the contribution ratio of the first principal component does not fall within the range of, for example, about 50 to 60% and the determination in step S704 is NO, it is determined that the main subject is not a circular object (step S706 in FIG. 7).

以上の図7および図8で説明した円形物判定処理の第2の実施形態により、例えば矩形指定された画像範囲の内接円中で、例えば第1主成分803と第2主成分804の寄与率がほぼ拮抗しているか否かにより主要被写体の支配色を有する画素がほぼ均一に分布しているか否かを判定することにより、画像範囲中の主要被写体が円形物であるか否かを判定することが可能となる。   According to the second embodiment of the circular object determination process described above with reference to FIGS. 7 and 8, for example, contributions of, for example, the first principal component 803 and the second principal component 804 in the inscribed circle of the image range designated by the rectangle Determine whether or not the main subject in the image range is a circular object by determining whether or not the pixels with the dominant color of the main subject are distributed almost uniformly depending on whether the rate is almost competitive It becomes possible to do.

次に、図4のステップS402およびS403で主要被写体が円形物であると判定されたときに実行される、図4のステップS404の同心円エッジ強調フィルタ生成処理の詳細について、以下に説明する。   Next, details of the concentric edge enhancement filter generation processing in step S404 in FIG. 4 executed when it is determined in steps S402 and S403 in FIG. 4 that the main subject is a circular object will be described below.

本実施形態では、主要被写体が円形物であると判定された場合には、下記数1式に示される重み付け(Gain)で、エッジ強調が行われる。   In this embodiment, when it is determined that the main subject is a circular object, edge emphasis is performed with weighting (Gain) expressed by the following equation (1).

この数1式において、P(xf,yf)は、エッジ強調フィルタ処理がされる注目画素の座標(xf,yf)における画素値である。この画素値は例えば、RGBのカラー画像データからYUV変換により変換された輝度値である。次に、座標(xd,yd)は、注目画素(xf,yf)に対するエッジ演算対象画素のオフセット値であり、例えばxd=±1、yd=±1である。エッジ強調が実行される際、例えば、注目画素に対して、注目画素と隣接画素の差分(エッジ成分)を加算する方法が一般的であるが、本実施形態では、そのエッジ成分を加算する際、数1式に示されるように、エッジの方向によって、重み付けGainが、下記数2式に従って、変更される。   In Equation 1, P (xf, yf) is a pixel value at the coordinates (xf, yf) of the target pixel on which the edge enhancement filter process is performed. This pixel value is, for example, a luminance value converted from RGB color image data by YUV conversion. Next, the coordinates (xd, yd) are offset values of the edge calculation target pixel with respect to the target pixel (xf, yf), and are, for example, xd = ± 1 and yd = ± 1. When edge enhancement is performed, for example, a method of adding a difference (edge component) between a pixel of interest and an adjacent pixel to the pixel of interest is common, but in this embodiment, when adding the edge component As shown in Equation 1, the weighting Gain is changed according to the following Equation 2 depending on the edge direction.

図9は、数2式に基づくゲイン算出処理の説明図である。数2式では、ユーザによって指定された画像範囲である矩形範囲901の中央902から注目画素903に向かう放射線904に対するエッジの微分方向905の角度φは、   FIG. 9 is an explanatory diagram of a gain calculation process based on Formula 2. In Equation 2, the angle φ of the differential direction 905 of the edge with respect to the radiation 904 from the center 902 of the rectangular range 901 that is the image range specified by the user toward the target pixel 903 is expressed as follows:

によって算出される。そして、数2式では、角度φに対して余弦(コサイン)の絶対値を計算した値を1から引いている。そして、Gainは、数2式に示されるようにして、注目画素の座標(xf,yf)と、注目画素に対するエッジ演算対象画素のオフセット座標(xd,yd)によって算出することができる。簡単のため、定数a=1,b=0で説明する。数2式のGainは、エッジの微分方向905が放射線904と同じ方向(φ=0)のときは、1−cos0=1−1=0となって、まったく強調されなくなる。エッジの微分方向905が放射線904と垂直方向の差分(φ=π/2ラジアン=90度)のときには、Gainは、1−cos(π/2)=1−0=1となり、放射線904と直交する同心円の円周方向のエッジ微分値に重み付けすることが可能となる。 Is calculated by In Equation 2, the value obtained by calculating the absolute value of the cosine with respect to the angle φ is subtracted from 1. Gain can be calculated from the coordinates (xf, yf) of the target pixel and the offset coordinates (xd, yd) of the edge calculation target pixel with respect to the target pixel, as shown in Equation 2. For simplicity, description will be made with constants a = 1 and b = 0. When the differential direction 905 of the edge is the same direction as the radiation 904 (φ = 0), the gain of Equation 2 becomes 1−cos0 = 1−1 = 0 and is not emphasized at all. When the edge differential direction 905 is the difference between the radiation 904 and the vertical direction (φ = π / 2 radians = 90 degrees), Gain is 1-cos (π / 2) = 1-0 = 1, and is orthogonal to the radiation 904. It is possible to weight the edge differential value in the circumferential direction of the concentric circles.

図10は、図4のステップS404の同心円強調フィルタ生成処理を示すフローチャートである。   FIG. 10 is a flowchart showing the concentric circle emphasis filter generation process in step S404 of FIG.

まず、前述した数2式および数3式により、ゲインが算出される(図10のステップS1001)。   First, the gain is calculated by the above-described equations (2) and (3) (step S1001 in FIG. 10).

次に、前述した数1式により、エッジ強調処理により、エッジ強調が実行される(図10のステップS1002)。   Next, edge emphasis is executed by edge emphasis processing according to the above-described equation (step S1002 in FIG. 10).

次に、図4のステップS405の領域分割処理について、説明する。
いま、
Next, the area dividing process in step S405 in FIG. 4 will be described.
Now

を、要素Xv がエッジ強調後の画像Vにおける画素vに対する領域ラベルを示す領域ラベルベクトルであるとする。この領域ラベルベクトルは、例えば、画素vが主要被写体領域内にあれば要素Xv =0、背景領域内にあれば要素Xv =1となるバイナリベクトルである。すなわち、 And an element X v is a region label vector indicating an area label for pixels v of the image V after edge emphasis. This area label vector is, for example, a binary vector having element X v = 0 if the pixel v is in the main subject area and element X v = 1 if it is in the background area. That is,

である。 It is.

本実施形態において実行される領域分割処理は、画像Vにおいて、次式で定義されるエネルギー関数E(X)を最小にするような数4式の領域ラベルベクトルXを求める処理である。   The area division process executed in the present embodiment is a process for obtaining an area label vector X of Formula 4 that minimizes an energy function E (X) defined by the following expression in the image V.

エネルギー最小化処理が実行される結果、領域ラベルベクトルX上で領域ラベル値Xv =0となる画素vの集合として、主要被写体領域が得られる。本実施形態の例でいえば、矩形枠内の花の領域である。なお、領域ラベルベクトルX上で領域ラベル値Xv =1となる画素vの集合が、背景領域(矩形枠外も含む)となる。 As a result of executing the energy minimization process, the main subject region is obtained as a set of pixels v having the region label value X v = 0 on the region label vector X. In the example of this embodiment, it is a flower area within a rectangular frame. Note that a set of pixels v with the region label value X v = 1 on the region label vector X is a background region (including outside the rectangular frame).

数6式のエネルギーを最小化するために、次式および図11で示される重み付き有向グラフ(以下「グラフ」と略す)を定義する。   In order to minimize the energy of Equation 6, the following equation and a weighted directed graph (hereinafter abbreviated as “graph”) shown in FIG. 11 are defined.

ここで、Vはノード(node)、Eはエッジ(edge)である。このグラフが画像の領域分割に適用される場合は、画像の各画素が各ノードVに対応する。また、画素以外のノードとして、次式および図11中に示される、 Here, V is a node and E is an edge. When this graph is applied to image area division, each pixel of the image corresponds to each node V. Further, as nodes other than pixels, the following formula and shown in FIG.

と呼ばれる特殊なターミナルが追加される。このソースsを主要被写体領域、シンクtを背景領域に対応付けて考える。また、エッジEは、ノードV間の関係を表現している。周辺の画素との関係を表したエッジEをn−link、各画素とソースs(主要被写体領域に対応)またはシンクt(背景領域に対応)との関係を表したエッジEをt−linkと呼ぶ。 A special terminal called is added. Consider the source s in association with the main subject region and the sink t in the background region. The edge E represents the relationship between the nodes V. An edge E representing the relationship with the surrounding pixels is n-link, and an edge E representing the relationship between each pixel and the source s (corresponding to the main subject region) or the sink t (corresponding to the background region) is t-link. Call.

いま、ソースsと各画素に対応するノードとを結ぶ各t−linkを、各画素がどの程度主要被写体領域らしいかを示す関係ととらえる。そして、その主要被写体領域らしさを示すコスト値を、数6式第1項に対応付けて、   Now, each t-link connecting the source s and the node corresponding to each pixel is regarded as a relationship indicating how much each pixel seems to be a main subject region. Then, a cost value indicating the likelihood of the main subject area is associated with the first term of Equation 6 and

と定義する。ここで、θ(c、0)は、学習用に用意した複数枚(数百枚程度)の主要被写体領域画像から算出したカラー画素値cごとのヒストグラム(出現回数)を示す関数データであり、例えば図12(a)に示されるように予め得られている。なお、θ(c、0)の全カラー画素値cにわたる総和は1になるように正規化されているものとする。また、I(v)は、エッジ強調制御(図4のステップS402〜S404の処理)の後の入力画像の各画素vにおけるカラー(RGB)画素値である。数9式において、θ(I(v)、0)の値が大きいほど、コスト値は小さくなる。これは、予め得られている主要被写体領域のカラー画素値の中で出現回数が多いものほど、数9式で得られるコスト値が小さくなって、画素vが主要被写体領域中の画素らしいことを意味し、数6式のエネルギー関数E(X)の値を押し下げる結果となる。 It is defined as Here, θ (c, 0) is function data indicating a histogram (number of appearances) for each color pixel value c calculated from a plurality of (several hundreds) main subject region images prepared for learning. For example, it is obtained in advance as shown in FIG. It is assumed that the sum total of θ (c, 0) over all color pixel values c is normalized to be 1. Further, I (v) is a color (RGB) pixel value at each pixel v of the input image after edge enhancement control (the processing of steps S402 to S404 in FIG. 4). In Equation 9, the cost value decreases as the value of θ (I (v), 0) increases. This is because, as the number of appearances of color pixel values of the main subject area obtained in advance increases, the cost value obtained by Equation 9 becomes smaller, and the pixel v seems to be a pixel in the main subject area. This means that the value of the energy function E (X) in Equation 6 is pushed down.

次に、シンクtと各画素に対応するノードとを結ぶ各t−linkを、各画素がどの程度背景領域らしいかを示す関係ととらえる。そして、その背景領域らしさを示すコスト値を、数6式第1項に対応付けて、   Next, each t-link connecting the sink t and the node corresponding to each pixel is regarded as a relationship indicating how much each pixel is a background region. Then, the cost value indicating the likelihood of the background region is associated with the first term of Equation 6 and

と定義する。ここで、θ(c、1)は、学習用に用意した複数枚(数百枚程度)の背景領域画像から算出したカラー画素値cごとのヒストグラム(出現度数)を示す関数データであり、例えば図12(b)に示されるように予め得られている。なお、θ(c、1)の全カラー画素値cにわたる総和は1になるように正規化されているものとする。I(v)は、数9式の場合と同様に、エッジ強調制御(図4のステップS402〜S404の処理)の後の入力画像の各画素vにおけるカラー(RGB)画素値である。数9式において、θ(I(v)、1)の値が大きいほど、コスト値は小さくなる。これは、予め得られている背景領域のカラー画素値の中で出現回数が多いものほど、数10式で得られるコスト値が小さくなって、画素vが背景領域中の画素らしいことを意味し、数6式のエネルギー関数E(X)の値を押し下げる結果となる。 It is defined as Here, θ (c, 1) is function data indicating a histogram (appearance frequency) for each color pixel value c calculated from a plurality (about several hundred) of background area images prepared for learning. It is obtained in advance as shown in FIG. It is assumed that the sum total of θ (c, 1) over all color pixel values c is normalized to be 1. I (v) is a color (RGB) pixel value in each pixel v of the input image after edge enhancement control (the processing of steps S402 to S404 in FIG. 4), as in the case of equation (9). In Equation 9, the cost value decreases as the value of θ (I (v), 1) increases. This means that the more frequently appearing color pixel values in the background area obtained in advance, the smaller the cost value obtained by Equation 10 is, and the pixel v seems to be a pixel in the background area. As a result, the value of the energy function E (X) in Equation 6 is pushed down.

次に、各画素に対応するノードとその周辺画素との関係を示すn−linkのコスト値を、数6式第2項に対応付けて、   Next, the cost value of n-link indicating the relationship between the node corresponding to each pixel and its surrounding pixels is associated with the second term of Equation 6;

と定義する。ここで、dist(u,v)は、画素vとその周辺画素uのユークリッド距離を示しており、κは所定の係数である。また、I(u)およびI(v)は、入力画像の各画素uおよびvにおける各カラー(RGB)画素値である。画素vおよびその周辺画素uの各領域ラベル値Xu およびXv が同一(Xu =Xv )となるように選択された場合における数11式のコスト値は0とされて、エネルギーE(X)の計算には影響しなくなる。一方、画素vとその周辺画素uの各領域ラベル値Xu およびXv が異なる(Xu ≠Xv )ように選択された場合における数11式のコスト値は、例えば図13に示される特性を有する関数特性となる。すなわち、画素vおよびその周辺画素uの各領域ラベル値Xu およびXv が異なっていて、かつ画素vおよびその周辺画素uのカラー画素値の差I(u)−I(v)が小さい場合には、数11式で得られるコスト値が大きくなる。この場合には、数6式のエネルギー関数E(X)の値が押し上げられる結果となる。言い換えれば、近傍画素間で、カラー画素値の差が小さい場合には、それらの画素の各領域ラベル値は、互いに異なるようには選択されない。すなわち、その場合には、近傍画素間では領域ラベル値はなるべく同じになって主要被写体領域または背景領域はなるべく変化しないように、制御される。一方、画素vおよびその周辺画素uの各領域ラベル値Xu およびXv が異なっていて、かつ画素vおよびその周辺画素uのカラー画素値の差I(u)−I(v)が大きい場合には、数11式で得られるコスト値が小さくなる。この場合には、数6式のエネルギー関数E(X)の値が押し下げられる結果となる。言い換えれば、近傍画素間で、カラー画素値の差が大きい場合には、主要被写体領域と背景領域の境界らしいことを意味し、画素vとその周辺画素uとで、領域ラベル値が異なる方向に制御される。 It is defined as Here, dist (u, v) indicates the Euclidean distance between the pixel v and the surrounding pixel u, and κ is a predetermined coefficient. Further, I (u) and I (v) are color (RGB) pixel values in the pixels u and v of the input image. When the region label values X u and X v of the pixel v and the surrounding pixels u are selected to be the same (X u = X v ), the cost value of Equation 11 is set to 0, and the energy E ( It does not affect the calculation of X). On the other hand, the cost value of Equation 11 when the region label values X u and X v of the pixel v and the surrounding pixels u are selected to be different (X u ≠ X v ) is, for example, the characteristic shown in FIG. It has a function characteristic having That is, when the region label values X u and X v of the pixel v and the surrounding pixel u are different, and the difference I (u) −I (v) between the pixel v and the surrounding pixel u is small. Therefore, the cost value obtained by Equation 11 is large. In this case, the value of the energy function E (X) in Expression 6 is pushed up. In other words, when the difference in color pixel value between neighboring pixels is small, the area label values of those pixels are not selected to be different from each other. In other words, in this case, the region label values are controlled to be the same between neighboring pixels and the main subject region or the background region is not changed as much as possible. On the other hand, when the region label values X u and X v of the pixel v and the surrounding pixel u are different and the difference I (u) −I (v) between the color values of the pixel v and the surrounding pixel u is large. Therefore, the cost value obtained by Equation 11 is small. In this case, the result is that the value of the energy function E (X) in Equation 6 is pushed down. In other words, if the color pixel value difference between neighboring pixels is large, it means that the boundary between the main subject region and the background region is likely, and the region label values in the direction where the pixel v and its surrounding pixels u are different. Be controlled.

以上の定義を用いて、入力画像の各画素vごとに、数9式によって、ソースsと各画素vとを結ぶt−linkのコスト値(主要被写体領域らしさ)が算出される。また、数10式によって、シンクtと各画素vとを結ぶt−linkのコスト値(背景領域らしさ)が算出される。さらに、入力画像の各画素vごとに、数11式によって、画素vとその周辺例えば8方向の各8画素とを結ぶ8本のn−linkのコスト値(境界らしさ)が算出される。   Using the above definition, a t-link cost value (likeness of a main subject area) connecting the source s and each pixel v is calculated for each pixel v of the input image by Equation (9). In addition, a cost value (likeness of background area) of t-link connecting the sink t and each pixel v is calculated by the equation (10). Further, for each pixel v of the input image, eight n-link cost values (likeness of boundary) connecting the pixel v and its surroundings, for example, each of eight pixels in eight directions, are calculated by Equation (11).

そして、理論的には、数4式の領域ラベルベクトルXの全ての領域ラベル値の0または1の組合せごとに、各領域ラベル値に応じて上記数9式、数10式、および数11式の計算結果が選択されながら数6式のエネルギー関数E(X)が計算される。そして、全ての組合せの中でエネルギー関数E(X)の値が最小となる領域ラベルベクトルXを選択することにより、領域ラベルベクトルX上で領域ラベル値Xv =0となる画素vの集合として、主要被写体領域を得ることができる。 Theoretically, for each combination of 0 or 1 of the region label values of the region label vector X of Equation 4, the above Equation 9, Equation 10, and Equation 11 according to each region label value. The energy function E (X) of Formula 6 is calculated while the calculation result of is selected. Then, by selecting the region label vector X that minimizes the value of the energy function E (X) among all the combinations, as a set of pixels v with the region label value X v = 0 on the region label vector X The main subject area can be obtained.

しかし実際には、領域ラベルベクトルXの全ての領域ラベル値の0または1の組合せ数は、2の画素数乗通りあるため、現実的な時間でエネルギー関数E(X)の最小化処理を計算することができない。   However, since the number of combinations of 0 or 1 of all region label values of the region label vector X is actually the number of pixels multiplied by 2, calculation of the energy function E (X) minimization process in a realistic time is calculated. Can not do it.

そこで、Graph Cuts法では、次のようなアルゴリズムを実行することにより、エネルギー関数E(X)の最小化処理を現実的な時間で計算することを可能にする。   Therefore, the Graph Cuts method makes it possible to calculate the energy function E (X) minimization process in a realistic time by executing the following algorithm.

図14は、上述した数9式、数10式で定義されるt−linkと数11式で定義されるn−linkを有するグラフと、領域ラベルベクトルXおよびグラフカットとの関係を、模式的に示した図である。図14では、理解の容易化のために、画素vは一次元的に示されている。   FIG. 14 schematically shows the relationship between the graph having t-link defined by Equation 9 and Equation 10 and n-link defined by Equation 11, the region label vector X, and the graph cut. It is the figure shown in. In FIG. 14, the pixels v are shown one-dimensionally for easy understanding.

数6式のエネルギー関数E(X)の第1項の計算で、領域ラベルベクトルX中の領域ラベル値が0となるべき主要被写体領域中の画素では、数9式と数10式のうち、主要被写体領域中の画素らしい場合により小さな値となる数9式のコスト値のほうが小さくなる。従って、ある画素において、ソースs側のt−linkが選択されシンクt側のt−linkがカットされて(図14の1402のケース)、数9式を用いて数6式のE(X)の第1項が計算された場合に、その計算結果が小さくなれば、その画素の領域ラベル値としては0が選択される。そして、そのグラフカット状態が採用される。計算結果が小さくならなければ、そのグラフカット状態は採用されず、他のリンクの探索およびグラフカットが試みられる。   In the calculation of the first term of the energy function E (X) of Equation 6, in the pixel in the main subject region where the region label value in the region label vector X should be 0, among Equation 9 and Equation 10, The cost value of equation (9), which is a smaller value depending on the pixel in the main subject area, is smaller. Therefore, in a certain pixel, t-link on the source s side is selected, and t-link on the sink t side is cut (case 1402 in FIG. 14), and E (X) in Equation 6 using Equation 9 If the calculation result becomes small when the first term is calculated, 0 is selected as the region label value of the pixel. Then, the graph cut state is adopted. If the calculation result does not become small, the graph cut state is not adopted and another link search and graph cut are attempted.

逆に、領域ラベルベクトルX中の領域ラベル値が1となるべき背景領域中の画素では、数9式と数10式のうち、背景領域中の画素らしい場合により小さな値となる数10式のコスト値のほうが小さくなる。従って、ある画素において、シンクt側のt−linkが選択されソースs側のt−linkはカットされて(図14の1403のケース)、数10式を用いて数6式のE(X)の第1項が計算された場合に、その計算結果が小さくなれば、その画素の領域ラベル値としては1が選択される。そして、そのグラフカット状態が採用される。計算結果が小さくならなければ、そのグラフカット状態は採用されず、他のリンクの探索およびグラフカットが試みられる。   Conversely, for pixels in the background region where the region label value in the region label vector X should be 1, among the equations (9) and (10), the equation The cost value is smaller. Therefore, in a certain pixel, t-link on the sink t side is selected, and t-link on the source s side is cut (case 1403 in FIG. 14), and E (X) in Equation 6 using Equation 10 When the first term is calculated, if the calculation result becomes small, 1 is selected as the region label value of the pixel. Then, the graph cut state is adopted. If the calculation result does not become small, the graph cut state is not adopted and another link search and graph cut are attempted.

一方、数6式のエネルギー関数E(X)の第1項の計算に係る上記グラフカット処理により、領域ラベルベクトルX中の領域ラベル値が0または1で連続すべき主要被写体領域内部または背景領域内部の画素間では、数11式のコスト値が0となる。従って、数11式の計算結果は、エネルギー関数E(X)の第2項のコスト値の計算には影響しない。また、その画素間のn−linkは、数11式がコスト値0を出力するように、カットされずに維持される。   On the other hand, by the above-described graph cut processing relating to the calculation of the first term of the energy function E (X) of Formula 6, the area label value in the area label vector X should be continuous within the main subject area or the background area with 0 or 1 The cost value of Equation 11 is 0 between the internal pixels. Therefore, the calculation result of Equation 11 does not affect the calculation of the cost value of the second term of the energy function E (X). Also, the n-link between the pixels is maintained without being cut so that Equation 11 outputs a cost value of 0.

ところが、エネルギー関数E(X)の第1項の計算に係る上記グラフカット処理により、近傍画素間で、領域ラベル値が0と1の間で変化した場合に、それらの画素間のカラー画素値の差が小さければ、数11式のコスト値が大きくなる。この結果、数6式のエネルギー関数E(X)の値が押し上げられる。このようなケースは、同一領域内で第1項の値による領域ラベル値の判定がたまたま反転するような場合に相当する。従って、このようなケースでは、エネルギー関数E(X)の値が大きくなって、そのような領域ラベル値の反転は選択されない結果となる。また、この場合には、数11式の計算結果が、上記結果を維持するように、それらの画素間のn−linkは、カットされずに維持される。   However, when the region label value changes between 0 and 1 between neighboring pixels by the graph cut processing relating to the calculation of the first term of the energy function E (X), the color pixel value between those pixels is changed. If the difference between the two is small, the cost value of Equation 11 becomes large. As a result, the value of the energy function E (X) in Expression 6 is pushed up. Such a case corresponds to a case where the determination of the region label value by the value of the first term happens to be reversed in the same region. Therefore, in such a case, the value of the energy function E (X) becomes large, and as a result, such inversion of the region label value is not selected. In this case, the n-link between the pixels is maintained without being cut so that the calculation result of Equation 11 maintains the above result.

これに対して、エネルギー関数E(X)の第1項の計算に係る上記グラフカット処理により、近傍画素間で、領域ラベル値が0と1の間で変化した場合に、それらの画素間のカラー画素値の差が大きければ、数11式のコスト値が小さくなる。この結果、数6式のエネルギー関数E(X)の値が押し下げられる。このようなケースは、それらの画素部分が主要被写体領域と背景領域の境界らしいことを意味している。従って、このようなケースでは、これらの画素間で領域ラベル値を異ならせて、主要被写体領域と背景領域の境界を形成する方向に制御される。また、この場合には、境界の形成状態を安定化するために、それらの画素間のn−linkがカットされて、数6式の第2項のコスト値が0にされる(図14の1404のケース)。   On the other hand, when the region label value changes between 0 and 1 between neighboring pixels by the graph cut processing relating to the calculation of the first term of the energy function E (X), If the difference between the color pixel values is large, the cost value of Equation 11 becomes small. As a result, the value of the energy function E (X) in Expression 6 is pushed down. Such a case means that these pixel portions are likely to be the boundary between the main subject area and the background area. Therefore, in such a case, the region label value is varied between these pixels, and the control is performed in the direction in which the boundary between the main subject region and the background region is formed. Further, in this case, in order to stabilize the boundary formation state, n-link between these pixels is cut, and the cost value of the second term of Equation 6 is set to 0 (FIG. 14). 1404).

以上の判定制御処理が、ソースsのノードを起点にして、順次各画素のノードをたどりながら繰り返されることにより、図14の1401で示されるようなグラフカットが実行され、エネルギー関数E(X)の最小化処理が現実的な時間で計算される。この処理の具体的な手法としては、例えば、非特許文献1に記載されている手法を採用することができる。   The determination control process described above is repeated starting from the node of the source s while sequentially tracing the nodes of each pixel, whereby a graph cut as shown by 1401 in FIG. 14 is executed, and the energy function E (X) The minimization process is calculated in a realistic time. As a specific method of this processing, for example, the method described in Non-Patent Document 1 can be adopted.

そして、各画素ごとに、ソースs側のt−linkが残っていれば、その画素の領域ラベル値として0、すなわち主要被写体領域の画素を示すラベルが付与される。逆に、シンクt側のt−linkが残っていれば、その画素の領域ラベル値として1、すなわち背景領域の画素を示すラベルが付与される。最終的に、領域ラベル値が0となる画素の集合として、主要被写体領域が得られる。   If t-link on the source s side remains for each pixel, 0 is given as the area label value of that pixel, that is, a label indicating the pixel of the main subject area is given. On the contrary, if t-link on the sink t side remains, 1 is given as the area label value of the pixel, that is, a label indicating the pixel in the background area is given. Finally, the main subject area is obtained as a set of pixels having the area label value of 0.

図15は、上述した動作原理に基づく図4のステップS405の領域分割処理を示すフローチャートである。   FIG. 15 is a flowchart showing the region division processing in step S405 of FIG. 4 based on the above-described operation principle.

まず、エッジ強調制御(図4のステップS402〜S404の処理)の後の画像から、カラー画素値I(V)が1つずつ読み込まれる(図15のステップS1501)。   First, the color pixel values I (V) are read one by one from the image after the edge enhancement control (the processes in steps S402 to S404 in FIG. 4) (step S1501 in FIG. 15).

次に、ステップS1501で読み込まれた画素が、ユーザによって指定された矩形枠内の画素であるか否かが判定される(図15のステップS1502)。   Next, it is determined whether or not the pixel read in step S1501 is a pixel within a rectangular frame designated by the user (step S1502 in FIG. 15).

ステップS1502の判定がYESの場合には、前述した数9式、数10式、および数11式に基づいて、主要被写体領域らしさを示すコスト値、背景領域らしさを示すコスト値、および境界らしさを示すコスト値が、それぞれ算出される(図15のステップS1503、S1504、およびS1505)。   If the determination in step S1502 is YES, the cost value indicating the likelihood of the main subject area, the cost value indicating the likelihood of the background area, and the likelihood of the boundary are calculated based on the above-described Formula 9, Formula 10, and Formula 11. The cost values shown are respectively calculated (steps S1503, S1504, and S1505 in FIG. 15).

一方、ステップS1502の判定がNOの場合には、矩形の枠外には主要被写体領域はないため、そこが主要被写体領域と判定されないようにするために、主要被写体領域らしさを示すコスト値gv (Xv )が、次式のように一定の大きな値Kとされる。 On the other hand, if the determination in step S1502 is NO, there is no main subject area outside the rectangular frame, and therefore a cost value g v ( X v ) is a constant large value K as shown in the following equation.

ここで、Kは、次式に示されるように、任意のピクセルの平滑化項の総和よりも大きい値を設定しておく(以上、図15のステップS1506)。 Here, as shown in the following equation, K is set to a value larger than the sum of the smoothing terms of any pixel (step S1506 in FIG. 15).

また、矩形の枠外が必ず背景領域と判定されるようにするために、背景領域らしさを示すコスト値gv (Xv )が、次式のように0とされる(図15のステップS1507)。 Further, in order to ensure that the outside of the rectangular frame is determined to be the background region, the cost value g v (X v ) indicating the likelihood of the background region is set to 0 as shown in the following equation (step S1507 in FIG. 15). .

さらに、矩形の枠外は全て背景領域であるため、huv(Xu ,Xv )の値は0とされる(図15のステップS1508)。 Furthermore, since all outside the rectangular frame is the background area, the value of h uv (X u , X v ) is set to 0 (step S1508 in FIG. 15).

以上の処理の後、画像内に処理すべき画素が残っているか否かが判定される(図15のステップS1509)。   After the above processing, it is determined whether or not there remains a pixel to be processed in the image (step S1509 in FIG. 15).

処理すべき画素がありステップS1509の判定がYESならば、ステップS1501の処理に戻って、上記処理が繰り返される。   If there is a pixel to be processed and the determination in step S1509 is YES, the process returns to step S1501 and the above process is repeated.

処理すべき画素がなくなりステップS1509の判定がNOになると、画像内の全ての画素について求まったコスト値を用いて、数6式のエネルギー関数E(X)が計算されながら、Graph Cutsアルゴリズムが実行され、主要被写体と背景が領域分割される(ステップS1510)。   When there is no pixel to be processed and the determination in step S1509 is NO, the Graph Cuts algorithm is executed while calculating the energy function E (X) of Equation 6 using the cost values obtained for all the pixels in the image. Then, the main subject and the background are divided into regions (step S1510).

以上説明した実施形態では、円形物の判定アルゴリズムとして、図5および図6で説明した主要被写体の事前切抜きおよびヒストグラムのビン値の比較による第1の実施形態の手法、または支配色を有する画素分布の主成分分析に基づく第1主成分の寄与率の判定による第2の実施形態の手法を説明した。しかしながら、このほか画像範囲内の主要被写体が円形物であるか否かを判定する手法として、種々の手法を採用することが可能である。   In the embodiment described above, as the circular object determination algorithm, the technique according to the first embodiment based on the pre-cutting of the main subject and the comparison of the bin values of the histogram described in FIGS. 5 and 6, or the pixel distribution having the dominant color The method of the second embodiment based on the determination of the contribution ratio of the first principal component based on the principal component analysis has been described. However, various other methods can be employed as a method for determining whether or not the main subject in the image range is a circular object.

また、上述の実施形態では、エッジ強調の実行時にエッジ強調フィルタのゲインが変動させられたが、平滑化フィルタhuv(Xu ,Xv )のゲインがエッジ強調フィルタの逆特性(放射方向のゲインを上げ、同心円方向のゲインを下げる)に変動させられる形態が採用されてもよい。 In the above-described embodiment, the gain of the edge enhancement filter is changed at the time of executing the edge enhancement. However, the gain of the smoothing filter h uv (X u , X v ) is the inverse characteristic of the edge enhancement filter (radiation direction). A mode in which the gain is increased and the gain in the concentric direction is decreased may be employed.

さらに、上述の実施形態では、数2式においてエッジ強調のゲインを算出するための係数aが固定にされたが、図9における矩形範囲901の中央902と注目画素903との距離に比例させる方法により、遠い放射方向ほどゲインを下げるにしてもよい。   Furthermore, in the above-described embodiment, the coefficient a for calculating the edge emphasis gain in Expression 2 is fixed, but the method of making it proportional to the distance between the center 902 of the rectangular range 901 and the target pixel 903 in FIG. Accordingly, the gain may be lowered as the radiation direction is farther.

以上の実施形態に関して、更に以下の付記を開示する。
(付記1)
画像内で指定された画像範囲内の主要被写体と該主要被写体以外の背景を領域分割する装置であって、
前記主要被写体が円形物であるか否かを判定する円形物判定手段と、
前記画像範囲内の注目画素ごとに、前記主要被写体が円形物であると判定された場合に、前記画像範囲内の中央と該注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行って該注目画素を出力し、前記主要被写体が円形物ではないと判定された場合に、該注目画素をそのまま出力するエッジ強調制御手段と、
前記注目画素ごとに前記エッジ強調の制御を行った前記画像内で前記主要被写体と前記背景を領域分割する領域分割手段と、
を備えることを特徴とする画像領域分割装置。
(付記2)
前記画像範囲は矩形範囲であり、
前記円形物判定手段は、
前記画像内で前記主要被写体と前記背景を事前に領域分割し、
前記事前に領域分割された前記主要被写体が前記画像範囲の境界線に接する率が第1の所定値に比較して小さいか否かを判定し、
前記接する率が前記第1の所定値に比較して小さいと判定された場合に、前記画像範囲に内接する円の内側の領域を該円の中心と該円の円周上の複数の点とをそれぞれ結ぶ複数の線分によって複数の領域に分割し、
該複数の領域ごとに前記主要被写体に属する画素の数を計数し、
前記複数の領域ごとの前記計数の結果の最大値と最小値の差が第2の所定値に比較して小さい場合に、前記主要被写体が円形物であると判定する、
ことを特徴とする付記1に記載の画像領域分割装置。
(付記3)
前記画像範囲は矩形範囲であり、
前記円形物判定手段は、前記画像範囲に内接する円内で支配的な色の分布状況が円形状であるか否かを判定することにより、前記主要被写体が円形物であるか否かを判定する、
ことを特徴とする付記1に記載の画像領域分割装置。
(付記4)
前記円形物判定手段は、
前記画像範囲に内接する円の領域に属する画素値をサンプリングし、
該サンプリングされた画素値を2つのクラスタにクラスタリングし、
該クラスタリングされた大きい方のクラスタに属する画素を前記支配的な色に属する画素とし、
該支配的な色に属する画素について、前記画像上の分布の主成分分析を行い、
該主成分分析で抽出された第1主成分の寄与率に基づいて、前記主要被写体が円形物であるか否かを判定する、
ことを特徴とする付記3に記載の画像領域分割装置。
(付記5)
前記エッジ強調制御手段は、
前記画像範囲内の注目画素ごとに、前記主要被写体が円形物であると判定された場合に、前記画像範囲内の中央と該注目画素を結ぶ放射線に対してエッジ強調の微分演算を行う方向がなす角度に応じたゲインを算出するゲイン算出手段と、
前記注目画素ごとに、前記主要被写体が円形物であると判定された場合に、前記エッジ強調の微分演算を行い、該微分演算の結果に、該微分演算を行う方向がなす前記角度に応じて算出されている前記ゲインにより重み付けを行い、該重み付けがされた前記微分演算の結果に基づいて、前記注目画素に対して前記エッジを強調する処理を行って該注目画素を出力するエッジ強調手段と、
をさらに備えることを特徴とする付記1ないし4のいずれかに記載の画像領域分割装置。
(付記6)
前記ゲイン算出手段は、前記ゲインを、前記角度の余弦値の絶対値を1から減算して得た値に基づいて決定する、
ことを特徴とする付記5に記載の画像領域分割装置。
(付記7)
前記領域分割手段は、前記注目画素ごとに前記エッジ強調を行った前記画像範囲内の各画素に付与する前記主要被写体または前記背景を示す領域ラベル値を更新しながら、該領域ラベル値と前記エッジ強調を行った画素値とに基づいて、前記主要被写体らしさまたは前記背景らしさと隣接画素間の前記画素値の変化を評価するエネルギー関数を定義し、該関数の最小化処理により前記画像内で前記主要被写体と前記背景を領域分割する、
ことを特徴とする付記1ないし6のいずれかに記載の画像領域分割装置。
(付記8)
前記領域分割手段は、Graph Cuts法により前記エネルギー関数の最小化処理を実行する、
ことを特徴とする付記7に記載の画像領域分割装置。
(付記9)
画像内で指定された画像範囲内の主要被写体と該主要被写体以外の背景を領域分割する方法であって、
前記主要被写体が円形物であるか否かを判定する円形物判定ステップと、
前記画像範囲内の注目画素ごとに、前記主要被写体が円形物であると判定された場合に、前記画像範囲内の中央と該注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行って該注目画素を出力し、前記主要被写体が円形物ではないと判定された場合に、該注目画素をそのまま出力するエッジ強調制御ステップと、
前記注目画素ごとに前記エッジ強調の制御を行った前記画像内で前記主要被写体と前記背景を領域分割する領域分割ステップと、
を実行することを備えることを特徴とする画像領域分割方法。
(付記10)
画像内で指定された画像範囲内の主要被写体と該主要被写体以外の背景を領域分割するコンピュータに、
前記主要被写体が円形物であるか否かを判定する円形物判定ステップと、
前記画像範囲内の注目画素ごとに、前記主要被写体が円形物であると判定された場合に、前記画像範囲内の中央と該注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行って該注目画素を出力し、前記主要被写体が円形物ではないと判定された場合に、該注目画素をそのまま出力するエッジ強調制御ステップと、
前記注目画素ごとに前記エッジ強調の制御を行った前記画像内で前記主要被写体と前記背景を領域分割する領域分割ステップと、
を実行させるためのプログラム。
Regarding the above embodiment, the following additional notes are disclosed.
(Appendix 1)
An apparatus that divides a main subject within an image range designated in an image and a background other than the main subject,
A circular object determining means for determining whether or not the main subject is a circular object;
Processing for emphasizing an edge in a direction orthogonal to the radiation connecting the center of the image range and the target pixel when it is determined that the main subject is a circular object for each target pixel of the image range To output the pixel of interest, and when it is determined that the main subject is not a circular object, edge enhancement control means for outputting the pixel of interest as it is;
Area dividing means for dividing the main subject and the background into areas in the image in which the edge enhancement is controlled for each pixel of interest;
An image region dividing apparatus comprising:
(Appendix 2)
The image range is a rectangular range;
The circular object determining means includes
In the image, the main subject and the background are segmented in advance,
Determining whether the pre-region-divided main subject touches the boundary of the image range is smaller than a first predetermined value;
When it is determined that the contact ratio is small compared to the first predetermined value, an inner area of a circle inscribed in the image range is defined as a center of the circle and a plurality of points on the circumference of the circle. Are divided into a plurality of regions by a plurality of line segments that respectively connect
Count the number of pixels belonging to the main subject for each of the plurality of areas,
Determining that the main subject is a circular object when a difference between a maximum value and a minimum value of the count results for each of the plurality of areas is small compared to a second predetermined value;
The image area dividing device according to Supplementary Note 1, wherein
(Appendix 3)
The image range is a rectangular range;
The circular object determining means determines whether or not the main subject is a circular object by determining whether or not the color distribution state dominant in the circle inscribed in the image range is a circular shape. To
The image area dividing device according to Supplementary Note 1, wherein
(Appendix 4)
The circular object determining means includes
Sampling pixel values belonging to a circle area inscribed in the image range;
Clustering the sampled pixel values into two clusters;
A pixel belonging to the clustered larger cluster is a pixel belonging to the dominant color,
Perform a principal component analysis of the distribution on the image for pixels belonging to the dominant color,
Determining whether or not the main subject is a circular object based on the contribution ratio of the first principal component extracted in the principal component analysis;
The image area dividing device according to Supplementary Note 3, wherein
(Appendix 5)
The edge enhancement control means includes
For each target pixel in the image range, when it is determined that the main subject is a circular object, there is a direction in which edge enhancement differentiation is performed on the radiation connecting the center in the image range and the target pixel. Gain calculating means for calculating a gain according to an angle formed;
For each pixel of interest, when it is determined that the main subject is a circular object, the edge enhancement differential operation is performed, and the result of the differential operation is determined according to the angle formed by the direction in which the differential operation is performed. An edge emphasizing unit that performs weighting by the calculated gain and performs processing for emphasizing the edge on the pixel of interest based on the weighted differential operation result, and outputs the pixel of interest. ,
The image region dividing device according to any one of appendices 1 to 4, further comprising:
(Appendix 6)
The gain calculating means determines the gain based on a value obtained by subtracting the absolute value of the cosine value of the angle from 1.
The image area dividing device according to Supplementary Note 5, wherein
(Appendix 7)
The region dividing unit updates the region label value and the edge while updating the region label value indicating the main subject or the background to be applied to each pixel in the image range in which the edge enhancement is performed for each pixel of interest. Based on the emphasized pixel value, an energy function is defined that evaluates the change in the pixel value between the main subject-likeness or the background-likeness and the adjacent pixels, and the function is minimized in the image. Dividing the main subject and the background into regions,
The image area dividing device according to any one of appendices 1 to 6, characterized in that:
(Appendix 8)
The region dividing unit performs the energy function minimization process by a Graph Cuts method.
The image area dividing device according to appendix 7, wherein
(Appendix 9)
A method for dividing a main subject in an image range designated in an image and a background other than the main subject,
A circular object determination step for determining whether or not the main subject is a circular object;
Processing for emphasizing an edge in a direction orthogonal to the radiation connecting the center of the image range and the target pixel when it is determined that the main subject is a circular object for each target pixel of the image range To output the target pixel, and when it is determined that the main subject is not a circular object, an edge enhancement control step of outputting the target pixel as it is;
A region dividing step of dividing the main subject and the background into regions in the image in which the edge enhancement is controlled for each pixel of interest;
An image region dividing method comprising: executing
(Appendix 10)
A computer that divides the main subject in the image range specified in the image and the background other than the main subject into regions,
A circular object determination step for determining whether or not the main subject is a circular object;
Processing for emphasizing an edge in a direction orthogonal to the radiation connecting the center of the image range and the target pixel when it is determined that the main subject is a circular object for each target pixel of the image range To output the target pixel, and when it is determined that the main subject is not a circular object, an edge enhancement control step of outputting the target pixel as it is;
A region dividing step of dividing the main subject and the background into regions in the image in which the edge enhancement is controlled for each pixel of interest;
A program for running

101 画像識別器生成装置
102 CPU
103 ROM
104 RAM
105 外部記憶装置
106 通信インタフェース
107 入力装置
108 表示装置
109 可搬記録媒体駆動装置
110 可搬記録媒体
111 バス
112 撮像装置
201 円形物判定手段
202 エッジ強調制御手段
203 領域分割手段
101 Image classifier generator 102 CPU
103 ROM
104 RAM
DESCRIPTION OF SYMBOLS 105 External storage device 106 Communication interface 107 Input device 108 Display device 109 Portable recording medium drive device 110 Portable recording medium 111 Bus 112 Imaging device 201 Circular object determination means 202 Edge emphasis control means 203 Area division means

Claims (10)

画像内で指定された画像範囲内の主要被写体と該主要被写体以外の背景を領域分割する装置であって、
前記主要被写体が円形物であるか否かを判定する円形物判定手段と、
前記主要被写体が円形物であると判定された場合に、前記画像範囲内の注目画素ごとに、前記画像範囲内の中央と該注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行って該注目画素を出力し、前記主要被写体が円形物ではないと判定された場合に、前記画像範囲内の各注目画素をそのまま出力するエッジ強調制御手段と、
前記注目画素ごとに前記エッジ強調の制御を行った前記画像内で前記主要被写体と前記背景を領域分割する領域分割手段と、
を備えることを特徴とする画像領域分割装置。
An apparatus that divides a main subject within an image range designated in an image and a background other than the main subject,
A circular object determining means for determining whether or not the main subject is a circular object;
When it is determined that the main subject is a circular object, for each target pixel in the image range, an edge in a direction orthogonal to the radiation connecting the center of the image range and the target pixel is emphasized To output the pixel of interest, and when it is determined that the main subject is not a circular object, edge enhancement control means for outputting each pixel of interest within the image range as it is;
Area dividing means for dividing the main subject and the background into areas in the image in which the edge enhancement is controlled for each pixel of interest;
An image region dividing apparatus comprising:
前記画像範囲は矩形範囲であり、
前記円形物判定手段は、
前記画像内で前記主要被写体と前記背景を事前に領域分割し、
前記事前に領域分割された前記主要被写体が前記画像範囲の境界線に接する率が第1の所定値に比較して小さいか否かを判定し、
前記接する率が前記第1の所定値に比較して小さいと判定された場合に、前記画像範囲に内接する円の内側の領域を該円の中心と該円の円周上の複数の点とをそれぞれ結ぶ複数の線分によって複数の領域に分割し、
該複数の領域ごとに前記主要被写体に属する画素の数を計数し、
前記複数の領域ごとの前記計数の結果の最大値と最小値の差が第2の所定値に比較して小さい場合に、前記主要被写体が円形物であると判定する、
ことを特徴とする請求項1に記載の画像領域分割装置。
The image range is a rectangular range;
The circular object determining means includes
In the image, the main subject and the background are segmented in advance,
Determining whether the pre-region-divided main subject touches the boundary of the image range is smaller than a first predetermined value;
When it is determined that the contact ratio is small compared to the first predetermined value, an inner area of a circle inscribed in the image range is defined as a center of the circle and a plurality of points on the circumference of the circle. Are divided into a plurality of regions by a plurality of line segments that respectively connect
Count the number of pixels belonging to the main subject for each of the plurality of areas,
Determining that the main subject is a circular object when a difference between a maximum value and a minimum value of the count results for each of the plurality of areas is small compared to a second predetermined value;
The image area dividing device according to claim 1, wherein
前記画像範囲は矩形範囲であり、
前記円形物判定手段は、前記画像範囲に内接する円内で支配的な色の分布状況が円形状であるか否かを判定することにより、前記主要被写体が円形物であるか否かを判定する、
ことを特徴とする請求項1に記載の画像領域分割装置。
The image range is a rectangular range;
The circular object determining means determines whether or not the main subject is a circular object by determining whether or not the color distribution state dominant in the circle inscribed in the image range is a circular shape. To
The image area dividing device according to claim 1, wherein
前記円形物判定手段は、
前記画像範囲に内接する円の領域に属する画素値をサンプリングし、
該サンプリングされた画素値を2つのクラスタにクラスタリングし、
該クラスタリングされた大きい方のクラスタに属する画素を前記支配的な色に属する画素とし、
該支配的な色に属する画素について、前記画像上の分布の主成分分析を行い、
該主成分分析で抽出された第1主成分の寄与率に基づいて、前記主要被写体が円形物であるか否かを判定する、
ことを特徴とする請求項3に記載の画像領域分割装置。
The circular object determining means includes
Sampling pixel values belonging to a circle area inscribed in the image range;
Clustering the sampled pixel values into two clusters;
A pixel belonging to the clustered larger cluster is a pixel belonging to the dominant color,
Perform a principal component analysis of the distribution on the image for pixels belonging to the dominant color,
Determining whether or not the main subject is a circular object based on the contribution ratio of the first principal component extracted in the principal component analysis;
The image area dividing device according to claim 3, wherein
前記主要被写体が円形物であると判定された場合に、前記エッジ強調制御手段は、
前記画像範囲内の注目画素ごとに、前記画像範囲内の中央と該注目画素を結ぶ放射線に対してエッジ強調の微分演算を行う方向がなす角度に応じたゲインを算出し、
前記注目画素ごとに、前記エッジ強調の微分演算を行い、該微分演算の結果に、該微分演算を行う方向がなす前記角度に応じて算出されている前記ゲインにより重み付けを行い、該重み付けがされた前記微分演算の結果に基づいて、前記注目画素に対して前記エッジを強調する処理を行って該注目画素を出力する、
ことを特徴とする請求項1ないし4のいずれかに記載の画像領域分割装置。
When it is determined that the main subject is a circular object, the edge enhancement control means
For each pixel of interest in the image range, calculate a gain according to an angle formed by a direction in which edge enhancement differentiation is performed on the radiation connecting the center of the image region and the pixel of interest;
For each pixel of interest, the edge emphasis differentiation operation is performed, and the result of the differentiation operation is weighted by the gain calculated according to the angle formed by the direction in which the differentiation operation is performed. Based on the result of the differentiation operation, the target pixel is output by performing a process of enhancing the edge on the target pixel.
The image area dividing device according to claim 1, wherein the image area dividing device is an image area dividing device according to claim 1.
前記ゲインの算出において、前記ゲインを、前記角度の余弦値の絶対値を1から減算して得た値に基づいて決定する、
ことを特徴とする請求項5に記載の画像領域分割装置。
In the calculation of the gain, the gain is determined based on a value obtained by subtracting the absolute value of the cosine value of the angle from 1.
The image area dividing device according to claim 5, wherein:
前記領域分割手段は、前記注目画素ごとに前記エッジ強調の制御を行った前記画像範囲内の各画素に付与する前記主要被写体または前記背景を示す領域ラベル値を更新しながら、該領域ラベル値と前記エッジ強調の制御を行った画素値とに基づいて、前記主要被写体らしさまたは前記背景らしさと隣接画素間の前記画素値の変化を評価するエネルギー関数を定義し、該関数の最小化処理により前記画像内で前記主要被写体と前記背景を領域分割する、
ことを特徴とする請求項1ないし6のいずれかに記載の画像領域分割装置。
The region dividing unit updates the region label value indicating the main subject or the background to be given to each pixel in the image range in which the edge enhancement is controlled for each pixel of interest, Based on the pixel value subjected to the edge enhancement control, an energy function for evaluating the main subjectness or backgroundness and a change in the pixel value between adjacent pixels is defined, and the function is minimized by the function minimization process. Dividing the main subject and the background into regions in an image;
7. The image area dividing device according to claim 1, wherein
前記領域分割手段は、Graph Cuts法により前記エネルギー関数の最小化処理を実行する、
ことを特徴とする請求項7に記載の画像領域分割装置。
The region dividing unit performs the energy function minimization process by a Graph Cuts method.
8. The image area dividing device according to claim 7, wherein
画像内で指定された画像範囲内の主要被写体と該主要被写体以外の背景を領域分割する方法であって、
前記主要被写体が円形物であるか否かを判定する円形物判定ステップと、
前記主要被写体が円形物であると判定された場合に、前記画像範囲内の注目画素ごとに、前記画像範囲内の中央と該注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行って該注目画素を出力し、前記主要被写体が円形物ではないと判定された場合に、前記画像範囲内の各注目画素をそのまま出力するエッジ強調制御ステップと、
前記注目画素ごとに前記エッジ強調の制御を行った前記画像内で前記主要被写体と前記背景を領域分割する領域分割ステップと、
を実行することを備えることを特徴とする画像領域分割方法。
A method for dividing a main subject in an image range designated in an image and a background other than the main subject,
A circular object determination step for determining whether or not the main subject is a circular object;
When it is determined that the main subject is a circular object, for each target pixel in the image range, an edge in a direction orthogonal to the radiation connecting the center of the image range and the target pixel is emphasized Performing edge enhancement and outputting the target pixel, and when it is determined that the main subject is not a circular object, an edge enhancement control step of outputting each target pixel within the image range as it is;
A region dividing step of dividing the main subject and the background into regions in the image in which the edge enhancement is controlled for each pixel of interest;
An image region dividing method comprising: executing
画像内で指定された画像範囲内の主要被写体と該主要被写体以外の背景を領域分割するコンピュータに、
前記主要被写体が円形物であるか否かを判定する円形物判定ステップと、
前記主要被写体が円形物であると判定された場合に、前記画像範囲内の注目画素ごとに、前記画像範囲内の中央と該注目画素を結ぶ放射線に対して直交する方向のエッジを強調する処理を行って該注目画素を出力し、前記主要被写体が円形物ではないと判定された場合に、前記画像範囲内の各注目画素をそのまま出力するエッジ強調制御ステップと、
前記注目画素ごとに前記エッジ強調の制御を行った前記画像内で前記主要被写体と前記背景を領域分割する領域分割ステップと、
を実行させるためのプログラム。
A computer that divides the main subject in the image range specified in the image and the background other than the main subject into regions,
A circular object determination step for determining whether or not the main subject is a circular object;
When it is determined that the main subject is a circular object, for each target pixel in the image range, an edge in a direction orthogonal to the radiation connecting the center of the image range and the target pixel is emphasized Performing edge enhancement and outputting the target pixel, and when it is determined that the main subject is not a circular object, an edge enhancement control step of outputting each target pixel within the image range as it is;
A region dividing step of dividing the main subject and the background into regions in the image in which the edge enhancement is controlled for each pixel of interest;
A program for running
JP2012261884A 2012-05-31 2012-11-30 Image region dividing apparatus, method, and program Expired - Fee Related JP5786838B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012261884A JP5786838B2 (en) 2012-05-31 2012-11-30 Image region dividing apparatus, method, and program

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2012125421 2012-05-31
JP2012125421 2012-05-31
JP2012261884A JP5786838B2 (en) 2012-05-31 2012-11-30 Image region dividing apparatus, method, and program

Publications (2)

Publication Number Publication Date
JP2014006871A true JP2014006871A (en) 2014-01-16
JP5786838B2 JP5786838B2 (en) 2015-09-30

Family

ID=50104493

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012261884A Expired - Fee Related JP5786838B2 (en) 2012-05-31 2012-11-30 Image region dividing apparatus, method, and program

Country Status (1)

Country Link
JP (1) JP5786838B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112862843A (en) * 2021-01-07 2021-05-28 北京惠朗时代科技有限公司 Official seal image segmentation method and system based on neighborhood pixel multi-weight decision
WO2024089763A1 (en) * 2022-10-25 2024-05-02 日本電信電話株式会社 Rectangular region inference device, rectangular region inference method, and program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05307537A (en) * 1991-09-12 1993-11-19 Fuji Photo Film Co Ltd Extracting method for border line of object to be photographed
JPH08272930A (en) * 1995-03-30 1996-10-18 Fuji Photo Film Co Ltd Image processing method
JP2008092515A (en) * 2006-10-05 2008-04-17 Nikon Corp Electronic camera, image processing apparatus and program
JP2011013925A (en) * 2009-07-02 2011-01-20 Secom Co Ltd Object detection device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05307537A (en) * 1991-09-12 1993-11-19 Fuji Photo Film Co Ltd Extracting method for border line of object to be photographed
JPH08272930A (en) * 1995-03-30 1996-10-18 Fuji Photo Film Co Ltd Image processing method
JP2008092515A (en) * 2006-10-05 2008-04-17 Nikon Corp Electronic camera, image processing apparatus and program
JP2011013925A (en) * 2009-07-02 2011-01-20 Secom Co Ltd Object detection device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
柴 涼介、外2名: ""分割画像のグラフカットに基づく高速かつ省メモリな画像前景抽出"", 電子情報通信学会論文誌, vol. 95, no. 3, JPN6015026356, 1 March 2012 (2012-03-01), JP, pages 628 - 637, ISSN: 0003106354 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112862843A (en) * 2021-01-07 2021-05-28 北京惠朗时代科技有限公司 Official seal image segmentation method and system based on neighborhood pixel multi-weight decision
WO2024089763A1 (en) * 2022-10-25 2024-05-02 日本電信電話株式会社 Rectangular region inference device, rectangular region inference method, and program

Also Published As

Publication number Publication date
JP5786838B2 (en) 2015-09-30

Similar Documents

Publication Publication Date Title
CN108229526B (en) Network training method, network training device, image processing method, image processing device, storage medium and electronic equipment
CN109978890B (en) Target extraction method and device based on image processing and terminal equipment
EP3537378B1 (en) Image processing apparatus and method for object boundary stabilization in an image of a sequence of images
Tong et al. Saliency detection with multi-scale superpixels
US9483835B2 (en) Depth value restoration method and system
CN110088805B (en) Method for detecting and segmenting a plurality of foreground objects
CN105184763B (en) Image processing method and device
JP6044134B2 (en) Image area dividing apparatus, method, and program according to optimum image size
JP6088792B2 (en) Image detection apparatus, control program, and image detection method
WO2020107717A1 (en) Visual saliency region detection method and apparatus
US9947077B2 (en) Video object tracking in traffic monitoring
US9367762B2 (en) Image processing device and method, and computer readable medium
KR102094506B1 (en) Method for measuring changes of distance between the camera and the object using object tracking , Computer readable storage medium of recording the method and a device measuring changes of distance
US10169673B2 (en) Region-of-interest detection apparatus, region-of-interest detection method, and recording medium
EP2782065B1 (en) Image-processing device removing encircling lines for identifying sub-regions of image
CN110852207A (en) Blue roof building extraction method based on object-oriented image classification technology
CN110111342B (en) Optimized selection method and device for matting algorithm
CN108647605B (en) Human eye gaze point extraction method combining global color and local structural features
CN112967305B (en) Image cloud background detection method under complex sky scene
JP5914046B2 (en) Image processing apparatus and image processing method
JP5786838B2 (en) Image region dividing apparatus, method, and program
CN107704864B (en) Salient object detection method based on image object semantic detection
JP2011170890A (en) Face detecting method, face detection device, and program
JP4967045B2 (en) Background discriminating apparatus, method and program
JP6546385B2 (en) IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREOF, AND PROGRAM

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20140929

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150624

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20150713

R150 Certificate of patent or registration of utility model

Ref document number: 5786838

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees