JP2012194919A - Image processing device, image processing method, image processing system, and image processing program - Google Patents

Image processing device, image processing method, image processing system, and image processing program Download PDF

Info

Publication number
JP2012194919A
JP2012194919A JP2011059829A JP2011059829A JP2012194919A JP 2012194919 A JP2012194919 A JP 2012194919A JP 2011059829 A JP2011059829 A JP 2011059829A JP 2011059829 A JP2011059829 A JP 2011059829A JP 2012194919 A JP2012194919 A JP 2012194919A
Authority
JP
Japan
Prior art keywords
contour
image
image processing
extracted
processing apparatus
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.)
Withdrawn
Application number
JP2011059829A
Other languages
Japanese (ja)
Inventor
Takeshi Suzuki
鈴木  剛
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2011059829A priority Critical patent/JP2012194919A/en
Publication of JP2012194919A publication Critical patent/JP2012194919A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

PROBLEM TO BE SOLVED: To set a control point of an initial contour appropriately depending on a shape of a region of interest that is extracted based on a feature of an image when a contour of the image is extracted using a dynamic contour model.SOLUTION: An image processing device includes a preprocessing part 22 that allows an input image to be subjected to resolution conversion and color space conversion as necessary, and an ROI candidate region extraction part 23 that extracts a region of interest. The image processing device further includes a control point creation part 24 that extracts, divides and samples a contour for the extracted region of interest to create a control point of the divided segment based on a feature of the divided contour.

Description

本発明は、動的輪郭モデルにより画像の輪郭抽出を行う画像処理装置、画像処理方法、画像処理システム、及び画像処理プログラムに関する。   The present invention relates to an image processing apparatus, an image processing method, an image processing system, and an image processing program that perform image contour extraction using a dynamic contour model.

画像中から物体(以下オブジェクト)を取り出すための処理には様々な種類があるが、その中でも動的輪郭モデル(Active Contour Model:ACM)は処理の柔軟性と速度の面で良好な性能を持つ方法である。   There are various types of processing for extracting an object (hereinafter referred to as an object) from an image. Among them, an active contour model (ACM) has good performance in terms of processing flexibility and speed. Is the method.

ACMにおいては、図22に示すように、画像に含まれる特定のオブジェクトに対して変形可能な閉曲線Lを設定し、その閉曲線Lのエネルギーを定義することにより、その閉曲線Lの状態を定量的に評価する。閉曲線Lのエネルギーは閉曲線Lがオブジェクトの輪郭に一致した場合に最小になるように定義されるものであり、これにより閉曲線Lをそのエネルギーが最小となるように変形させることでオブジェクトの輪郭を抽出することができる。閉曲線Lはその閉曲線Lを形成する離散的に配置された制御点Pを連結したものであり、ACMの多くの方法では制御点間をスプライン法などで補間して実際の輪郭にする。実際にACMで制御されるのはこの制御点であり、制御点の位置を決めるためのコスト関数が動的輪郭モデルの根幹である。   In ACM, as shown in FIG. 22, by setting a deformable closed curve L for a specific object included in an image and defining the energy of the closed curve L, the state of the closed curve L is quantitatively determined. evaluate. The energy of the closed curve L is defined so as to be minimized when the closed curve L matches the contour of the object. Thus, the contour of the object is extracted by deforming the closed curve L so that the energy is minimized. can do. The closed curve L is a connection of discretely arranged control points P forming the closed curve L. In many methods of ACM, the control points are interpolated by a spline method or the like to form an actual contour. It is this control point that is actually controlled by the ACM, and the cost function for determining the position of the control point is the basis of the active contour model.

この制御点とコスト関数は事前実験などにより、対象となる画像に適したものを構成することになるが、一般に制御点の初期位置(つまり初期輪郭)は、ACM計算収束までの時間と、最終的に得られる輪郭の精度の両方に大きな影響を与える。   These control points and cost functions will be suitable for the target image by prior experiments, etc., but in general, the initial position of the control points (that is, the initial contour) is the time until the convergence of the ACM calculation and the final This greatly affects both the accuracy of the contour obtained.

初期輪郭の与え方には様々な方法があるが、最も単純なものは、抽出すべきオブジェクトが画面中央に存在すると仮定し、画像周辺部や画像中央に中心を持つ円を初期輪郭として利用する方法である(特許文献1)。この方法は前記の仮定が成立しないことが多いために、収束までの計算速度、輪郭の精度のいずれの面でも劣っている。   There are various methods for giving the initial contour, but the simplest method assumes that the object to be extracted exists at the center of the screen, and uses a circle having a center at the periphery of the image or at the center of the image as the initial contour. It is a method (patent document 1). Since this method often does not hold the above assumption, it is inferior in both the calculation speed until convergence and the accuracy of the contour.

より高度な方法としては、画像中の特定の特徴量(例えば分散値)などを利用し、画像中のROI(Region Of Interest:注目領域)の候補を求め、その周囲に初期輪郭を構成する方法がある(特許文献2)。しかし、この文献には、初期輪郭を構成する制御点をROI候補の形状に応じて適切に設定することは考慮されていない。   As a more advanced method, a method for obtaining an ROI (Region Of Interest) candidate in an image by using a specific feature amount (for example, a variance value) in the image and constructing an initial outline around the candidate (Patent Document 2). However, this document does not consider appropriately setting the control points constituting the initial contour according to the shape of the ROI candidate.

本発明は、このような問題を解決するためになされたものであり、その目的は、動的輪郭モデルにより画像の輪郭抽出を行うときに、画像の特徴を基に抽出した注目領域の形状に応じて、初期輪郭の制御点を適切に設定できるようにすることである。   The present invention has been made to solve such a problem, and its purpose is to obtain the shape of a region of interest extracted based on the features of an image when extracting the contour of the image using an active contour model. Accordingly, it is possible to appropriately set the control points of the initial contour.

本発明の画像処理装置は、動的輪郭モデルにより画像の輪郭抽出を行う画像処理装置であって、画像の予め定められた特徴を基に注目領域を抽出する注目領域抽出手段と、前記抽出された注目領域の輪郭を抽出する輪郭抽出手段と、前記抽出された輪郭の形状を評価する輪郭形状評価手段と、前記評価の結果に基づいて、前記抽出された輪郭をサンプリングする制御点を設定する制御点設定手段とを有する画像処理装置である。
本発明の画像処理方法は、動的輪郭モデルにより画像の輪郭抽出を行う画像処理方法であって、画像の予め定められた特徴を基に注目領域を抽出する注目領域抽出工程と、前記抽出された注目領域の輪郭を抽出する輪郭抽出工程と、前記抽出された輪郭の形状を評価する輪郭形状評価工程と、前記評価の結果に基づいて、前記抽出された輪郭をサンプリングする制御点を設定する制御点設定工程とを有する画像処理方法である。
本発明の画像処理プログラムは、コンピュータを、本発明の画像処理装置の各手段として機能させるための画像処理プログラムである。
本発明の画像処理システムは、動的輪郭モデルにより画像の輪郭抽出を行う画像処理システムであって、画像の予め定められた特徴を基に注目領域を抽出する注目領域抽出手段と、前記抽出された注目領域の輪郭を抽出する輪郭抽出手段と、前記抽出された輪郭の形状を評価する輪郭形状評価手段と、前記評価の結果に基づいて、前記抽出された輪郭をサンプリングする制御点を設定する制御点設定手段とを有する画像処理システムである。
An image processing apparatus according to the present invention is an image processing apparatus that performs contour extraction of an image using an active contour model, and includes a region of interest extraction unit that extracts a region of interest based on a predetermined feature of the image, and the extracted A contour extracting means for extracting the contour of the attention area; a contour shape evaluating means for evaluating the shape of the extracted contour; and a control point for sampling the extracted contour based on the result of the evaluation. An image processing apparatus having control point setting means.
The image processing method of the present invention is an image processing method for extracting an image contour using an active contour model, and includes an attention region extraction step of extracting a attention region based on a predetermined feature of the image, and the extracted A contour extraction step for extracting the contour of the attention area, a contour shape evaluation step for evaluating the shape of the extracted contour, and a control point for sampling the extracted contour based on the result of the evaluation And a control point setting step.
The image processing program of the present invention is an image processing program for causing a computer to function as each unit of the image processing apparatus of the present invention.
An image processing system according to the present invention is an image processing system that performs contour extraction of an image using an active contour model, and includes a region of interest extraction means for extracting a region of interest based on a predetermined feature of the image, and the extracted A contour extracting means for extracting the contour of the attention area; a contour shape evaluating means for evaluating the shape of the extracted contour; and a control point for sampling the extracted contour based on the result of the evaluation. An image processing system having control point setting means.

本発明によれば、動的輪郭モデルにより画像の輪郭抽出を行うときに、画像の特徴を基に抽出した注目領域の形状に応じて、初期輪郭の制御点を適切に設定することができる。   According to the present invention, when performing contour extraction of an image using an active contour model, it is possible to appropriately set the control points of the initial contour according to the shape of the region of interest extracted based on the features of the image.

本発明の第1の実施形態の画像処理装置を有する画像処理システムを示す図である。1 is a diagram illustrating an image processing system having an image processing apparatus according to a first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置における画像入力から制御点生成までの流れを示す図である。It is a figure which shows the flow from the image input in the image processing apparatus of the 1st Embodiment of this invention to control point production | generation. 本発明の第1の実施形態の画像処理装置の機能ブロック図である。1 is a functional block diagram of an image processing apparatus according to a first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置のコンポーネントレベルの振る舞いを示すシーケンス図である。It is a sequence diagram which shows the behavior of the component level of the image processing apparatus of the 1st Embodiment of this invention. 本発明の第1の実施形態の画像処理装置における領域分割処理の機能ブロック図である。FIG. 3 is a functional block diagram of region division processing in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置における領域分割処理のシーケンス図である。FIG. 5 is a sequence diagram of region division processing in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置における領域統合処理の機能ブロック図である。FIG. 3 is a functional block diagram of region integration processing in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置における領域統合処理のシーケンス図である。It is a sequence diagram of the area | region integration process in the image processing apparatus of the 1st Embodiment of this invention. 本発明の第1の実施形態の画像処理装置における制御点生成処理の機能ブロック図である。It is a functional block diagram of a control point generation process in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置における制御点生成処理のシーケンス図である。It is a sequence diagram of a control point generation process in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置において、注目領域の輪郭上の点毎の微分値の加重移動平均値の算出に用いる関数の一例を示す図である。It is a figure which shows an example of the function used for calculation of the weighted moving average value of the differential value for every point on the outline of an attention area in the image processing device of a 1st embodiment of the present invention. 本発明の第1の実施形態の画像処理装置において、部分輪郭に対してサンプリングを行って制御点を生成する処理の一例を示すフローチャートである。5 is a flowchart illustrating an example of processing for generating a control point by sampling a partial contour in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置において、部分輪郭に対してサンプリングを行って制御点を生成する処理の別の一例を示すフローチャートである。It is a flowchart which shows another example of the process which samples in a partial outline and produces | generates a control point in the image processing apparatus of the 1st Embodiment of this invention. 本発明の第1の実施形態の画像処理装置において、ハフ変換を用いた輪郭分割処理を示すフローチャートである。5 is a flowchart illustrating contour division processing using Hough transform in the image processing apparatus according to the first embodiment of the present invention. 本発明の第1の実施形態の画像処理装置において、ハフ変換を用いた輪郭分割処理を説明するための図である。It is a figure for demonstrating the outline division | segmentation process using Hough transform in the image processing apparatus of the 1st Embodiment of this invention. ハフ変換を用いた輪郭分割処理により実行される輪郭からの直線区間の抽出を説明するための図である。It is a figure for demonstrating the extraction of the straight line area from the outline performed by the outline division process using Hough transform. ハフ変換を用いた輪郭分割処理において抽出される可能性のある擬似直線を示す図である。It is a figure which shows the pseudo | simulation line which may be extracted in the contour division | segmentation process using Hough transform. 本発明の第2の実施形態の画像処理装置において、1枚の画像中で画像中心に重心が最も近い輪郭を検出する処理を示すフローチャートである。It is a flowchart which shows the process which detects the outline whose gravity center is the closest to the image center in one image in the image processing apparatus of the 2nd Embodiment of this invention. 本発明の第2の実施形態の画像処理装置において、輪郭全体の形状の微分値の平均値及び標準偏差値を基に等間隔サンプリングの間隔を決定する処理のフローチャートである。It is a flowchart of the process which determines the space | interval of equidistant sampling based on the average value and standard deviation value of the differential value of the shape of the whole outline in the image processing apparatus of the 2nd Embodiment of this invention. 本発明の第2の実施形態の画像処理装置において、1枚の画像中で最長の輪郭を検出する処理を示すフローチャートである。It is a flowchart which shows the process which detects the longest outline in one image in the image processing apparatus of the 2nd Embodiment of this invention. 本発明の第2の実施形態の画像処理装置において、1枚の画像中の全ての輪郭の微分値の平均値及び標準偏差値を基に等間隔サンプリングの間隔を決定する処理のフローチャートである。It is a flowchart of the process which determines the space | interval of equidistant sampling based on the average value and standard deviation value of the differential value of all the contours in one image in the image processing apparatus of the 2nd Embodiment of this invention. 動的輪郭モデルの概略を示す図である。It is a figure which shows the outline of an active contour model.

以下、本発明の実施の形態について、図面を参照して説明する。
[第1の実施形態]
〈実施形態全体の概要〉
本実施形態では、ウォーターシェッド(Watershed)法などの簡易的な領域分割法を前処理として利用することで、動的輪郭モデルに適切な初期輪郭を、少ないユーザ作業量で与えることができる。
Embodiments of the present invention will be described below with reference to the drawings.
[First Embodiment]
<Overview of overall embodiment>
In the present embodiment, by using a simple area division method such as a watershed method as preprocessing, an initial contour suitable for the dynamic contour model can be given with a small amount of user work.

本実施形態によると、少ないユーザ作業量で、ユーザの意図する抽出対象オブジェクトを指定することができ、且つ、オブジェクト輪郭の実際の詳細な抽出はシステムが行うために、ユーザの全体の作業量を顕著に低減することができる。   According to the present embodiment, the extraction target object intended by the user can be specified with a small amount of user work, and the actual detailed extraction of the object contour is performed by the system. It can be significantly reduced.

本実施形態の処理は大きく分けて2段階からなる。ROIを抽出する段階と、ROIから輪郭を抽出し、その輪郭をサンプリングし、制御点を定める段階である。   The processing of this embodiment is roughly divided into two stages. An ROI is extracted, and a contour is extracted from the ROI, the contour is sampled, and a control point is determined.

ROI抽出には様々な方法がある。本実施形態では、領域成長法の一つであるウォーターシェッド法を用いた場合について説明するが、他の方法を用いてもよい。ウォーターシェッド法は、いくつかのシード点から、グラディエントの和が一定になるように領域を成長させ、他のシード点からの領域との接触線を最終的な輪郭とする、領域成長法による画像分割法である(「http://en.wikipedia.org/wiki/Watershed_%28algorithm%29」参照)。この方法では、シード点はユーザが指定することが基本となるが、他の方法によるROI情報などを用いて自動的にシード点を設定することもできる。   There are various methods for ROI extraction. In the present embodiment, the case where the water shed method, which is one of the region growing methods, is described, but other methods may be used. The watershed method grows an area from several seed points so that the sum of gradients is constant, and the contact line with the area from other seed points is the final contour image. This is a division method (see "http://en.wikipedia.org/wiki/Watershed_%28algorithm%29"). In this method, the seed point is basically specified by the user, but it is also possible to automatically set the seed point using ROI information by other methods.

ウォーターシェッド法では、シード点の数だけ領域が生じるが、一般的にウォーターシェッド法では複雑なオブジェクトを抽出するために、一つのオブジェクトに対して複数のシード点が必要となり、所謂過分割の状態となりやすい。そのため一旦分割した後、抽出対象のオブジェクトの輪郭となるように、領域の統合を行うことがある。この領域の統合には例えばスプリット・アンド・マージ(Split-and-Merge)法(「http://homepage.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MARBLE/medium/segment/split.htm」参照)などを用いることができる。   In the watershed method, there are as many regions as the number of seed points. In general, the watershed method requires multiple seed points for a single object in order to extract complex objects. It is easy to become. Therefore, after dividing once, the regions may be integrated so that the outline of the object to be extracted is obtained. For example, the split-and-merge method (“http://homepage.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/MARBLE/medium/segment/split. etc.) can be used.

抽出対象のオブジェクトと領域が一意に対応付けできた後、これをROI候補領域と呼ぶことにする。次にこのROI候補領域の輪郭を抽出する。ROI候補領域は他の領域と二値的に識別できるため、この輪郭抽出は単純な二値画像からの輪郭抽出法を用いることができる。   After an object to be extracted and a region can be uniquely associated, this is called a ROI candidate region. Next, the outline of this ROI candidate area is extracted. Since the ROI candidate region can be binaryly distinguished from other regions, this contour extraction can use a simple contour extraction method from a binary image.

ここで抽出された輪郭は連続線情報であるため、このまま動的輪郭モデルで利用することはできない。そのため抽出された輪郭をサンプリングし、制御点を設定する必要がある。曲線のサンプリングにも様々な手法がある。最も単純には、等間隔サンプリング法があるが、これは輪郭形状にかかわらず一定の間隔でサンプリングするため、後処理である動的輪郭モデルにおける輪郭形状追従性が悪くなり適切ではない。輪郭形状に従ってサンプリング間隔を調整する不等間隔サンプリング方式には例えば「The-Chin チェーンの近似アルゴリズム」のような方法があり、これにより後段の動的輪郭モデルで高い精度が期待できるような、制御点を設定することができる。これは端的には、複雑な形状部には多くの制御点を、簡単な形状の部分には少数の制御点を割り振る方法といえる。このような処理の組み合わせにより、動的輪郭モデルで初期輪郭として利用するのに好適な、制御点を構成することができる。   Since the contour extracted here is continuous line information, it cannot be used in the active contour model as it is. Therefore, it is necessary to sample the extracted contour and set control points. There are various methods for sampling a curve. In the simplest case, there is an equally-spaced sampling method. However, since sampling is performed at a constant interval regardless of the contour shape, the contour shape following property in the dynamic contour model as post-processing is deteriorated, which is not appropriate. For example, there is a method like “The-Chin chain approximation algorithm” that adjusts the sampling interval according to the contour shape. A point can be set. In short, this can be said to be a method in which many control points are assigned to a complicated shape portion and a small number of control points are assigned to a simple shape portion. By combining such processes, it is possible to configure control points suitable for use as the initial contour in the dynamic contour model.

〈画像処理システムの構成〉
図1に本発明の実施形態の画像処理装置を有する画像処理システムを示す。この画像処理システムは、ネットワーク2と、それぞれがネットワーク2に接続された画像処理装置1、画像取得装置3、画像出力装置4、及び記憶装置5からなる。
<Image processing system configuration>
FIG. 1 shows an image processing system having an image processing apparatus according to an embodiment of the present invention. The image processing system includes a network 2, an image processing device 1, an image acquisition device 3, an image output device 4, and a storage device 5 each connected to the network 2.

画像取得装置3はイメージスキャナやデジタルカメラなど、写真、原稿、風景などの画像の画像情報を取得する装置である。画像出力装置4は電子写真記録方式やインクジェット記録方式のプリンタやプロッタからなる画像を形成する装置である。記憶装置5はHDD(ハードディスクドライブ)などの大容量の外部記憶装置である。   The image acquisition apparatus 3 is an apparatus such as an image scanner or a digital camera that acquires image information of images such as photographs, documents, and landscapes. The image output apparatus 4 is an apparatus that forms an image composed of an electrophotographic recording system or an inkjet recording system printer or plotter. The storage device 5 is a large-capacity external storage device such as an HDD (hard disk drive).

画像処理装置1は、コンピュータにより構成されており、画像処理装置内部バス11と、それぞれが画像処理装置内部バス11に接続されたCPU(Central Processing Unit)12、ROM(Read Only Memory)13、RAM(Random Access Memory)14、記憶装置15、操作装置16、表示装置17、及び通信装置18を有する。   The image processing apparatus 1 is configured by a computer and includes an image processing apparatus internal bus 11, a CPU (Central Processing Unit) 12, a ROM (Read Only Memory) 13, a RAM connected to the image processing apparatus internal bus 11, and a RAM. (Random Access Memory) 14, storage device 15, operation device 16, display device 17, and communication device 18.

CPU12は、ROM13や記憶装置15に格納されているプログラムやデータをRAM14に読み込んで実行することにより、この画像処理装置1の全体の制御などを行うプロセッサである。ROM13はプログラムやデータを記憶するメモリである。RAM14は、CPU12が各種動作を行うときにプログラムやデータを一時的に記憶するメモリである。記憶装置15はHDDからなり、CPU12が各種動作を行うときに使用するプログラムやデータを記憶する内部記憶装置である。   The CPU 12 is a processor that performs overall control of the image processing apparatus 1 by reading the program and data stored in the ROM 13 and the storage device 15 into the RAM 14 and executing them. The ROM 13 is a memory for storing programs and data. The RAM 14 is a memory that temporarily stores programs and data when the CPU 12 performs various operations. The storage device 15 is an HDD, and is an internal storage device that stores programs and data used when the CPU 12 performs various operations.

操作装置16は、キーボード、マウスなど、ユーザが画像処理装置1を操作するためのユーザインタフェースである。表示装置17は、LCD(Liquid Crystal Display)やCRT(Cathode Ray Tube)など、操作装置16から入力した情報や画像処理装置1の動作状態などを表示するユーザインタフェースである。通信装置18は、ネットワーク2を介して、画像取得装置3、画像出力装置4、記憶装置5とデータ通信を行うための装置である。   The operation device 16 is a user interface such as a keyboard and a mouse for the user to operate the image processing device 1. The display device 17 is a user interface that displays information input from the operation device 16 such as an LCD (Liquid Crystal Display) or a CRT (Cathode Ray Tube), an operation state of the image processing device 1, and the like. The communication device 18 is a device for performing data communication with the image acquisition device 3, the image output device 4, and the storage device 5 via the network 2.

このような構成により、画像処理装置1は内部の記憶装置15、外部の記憶装置5のいずれかに保持される画像情報、もしくは画像取得装置3により取得される画像情報を取得する。次に作業用のRAM14にその入力画像情報を展開し、予め定められた処理方法によりこれを処理する。この結果は記憶装置15もしくはネットワーク2経由で記憶装置5に保持することができる。ユーザからの指示に従い、システムはRAM14に展開された処理済み画像情報をネットワーク2経由で画像出力装置4に送り、ハードコピーを作成することができる。   With such a configuration, the image processing apparatus 1 acquires image information held in either the internal storage device 15 or the external storage device 5 or image information acquired by the image acquisition device 3. Next, the input image information is developed in the working RAM 14 and processed by a predetermined processing method. This result can be held in the storage device 5 via the storage device 15 or the network 2. In accordance with an instruction from the user, the system can send the processed image information expanded in the RAM 14 to the image output device 4 via the network 2 to create a hard copy.

〈画像入力から制御点生成処理までの流れ〉
図2は、本実施形態の画像処理装置1に画像が入力されてから初期輪郭の制御点が生成されるまでの流れを示す図である。
<Flow from image input to control point generation processing>
FIG. 2 is a diagram illustrating a flow from when an image is input to the image processing apparatus 1 according to the present embodiment to when an initial contour control point is generated.

図示のように、入力画像は、順次、画像処理部21内の前処理部22と、ROI候補領域抽出部23と、制御点生成部24で処理される。
前処理部22は、与えられた入力画像を後段の処理に適する形に変換するための解像度変換部221と色空間変換部222を備えている。入力画像の解像度が高すぎる場合には処理速度向上のために、解像度変換部221により、後段の処理で用いる解像度に変換してもよい。また入力画像の色空間が後段の処理での色空間と異なる場合には、色空間変換部222により、適時色空間変換を行う。
As shown in the figure, the input image is sequentially processed by the preprocessing unit 22, the ROI candidate region extraction unit 23, and the control point generation unit 24 in the image processing unit 21.
The pre-processing unit 22 includes a resolution conversion unit 221 and a color space conversion unit 222 for converting a given input image into a form suitable for subsequent processing. If the resolution of the input image is too high, the resolution conversion unit 221 may convert the resolution to the resolution used in the subsequent processing in order to improve the processing speed. Further, when the color space of the input image is different from the color space in the subsequent processing, the color space conversion unit 222 performs timely color space conversion.

ROI候補領域抽出部23は初期輪郭のもとになるROI候補領域を抽出するものであり、領域分割部231とその後の領域統合部232からなる。領域分割部231はここでは領域成長法の一つであるウォーターシェッド法を用いる。ウォーターシェッド法では、グレーレベルに変換した入力画像からグラディエントを計算し、別途設定されたシード点からのグラディエント和が一定になるように領域分割を行う。   The ROI candidate area extraction unit 23 extracts an ROI candidate area that is the basis of the initial contour, and includes an area dividing unit 231 and a subsequent region integration unit 232. Here, the region dividing unit 231 uses a watershed method which is one of region growing methods. In the watershed method, a gradient is calculated from an input image converted to a gray level, and region division is performed so that the gradient sum from a seed point set separately is constant.

ウォーターシェッド法では一般的に過分割になる傾向があり、そのため抽出したいオブジェクト1つに対して複数の領域が発生することがある。その場合にはユーザの指示により、領域を統合し、抽出するオブジェクトと一対一に領域が対応するようにする。この処理は領域統合部232で行われ、例えばスプリット・アンド・マージアルゴリズムの統合部を用いて処理することができる。この領域統合により、オブジェクト周囲のROI候補領域が設定される。   The watershed method generally tends to be over-divided, so that a plurality of regions may be generated for one object to be extracted. In that case, the areas are integrated according to the user's instruction so that the areas correspond one-to-one with the object to be extracted. This processing is performed by the region integration unit 232 and can be processed using, for example, an integration unit of a split and merge algorithm. By this region integration, ROI candidate regions around the object are set.

制御点生成部24の輪郭抽出部241では、ROI候補領域の輪郭抽出を行う。ウォーターシェッド法及びスプリット・アンド・マージ処理により既にROI候補領域は他の領域と区別するためのフラグを与えられているため、二値画像からの輪郭抽出処理となり、簡易な方法で輪郭を抽出することができる。このとき、抽出すべきオブジェクト領域のトポロジーが1でない場合(ドーナツ状などで領域に穴があいている場合)、内部の穴の周囲にも輪郭を構成することができる。この場合、領域外周部の輪郭と内周部の輪郭を別の輪郭としてそれぞれ輪郭抽出→制御点生成を行うことで、複雑な形状の領域も抽出することができるようになる。   The contour extraction unit 241 of the control point generation unit 24 performs contour extraction of the ROI candidate region. Since the ROI candidate area has already been given a flag for distinguishing it from other areas by the watershed method and the split-and-merge process, the outline extraction process is performed from the binary image, and the outline is extracted by a simple method. be able to. At this time, when the topology of the object region to be extracted is not 1 (when the region has a hole in a donut shape or the like), a contour can be formed around the inner hole. In this case, a region having a complicated shape can be extracted by performing contour extraction → control point generation with the contour of the outer peripheral portion of the region and the contour of the inner peripheral portion as different contours.

最後にサンプリング部242では、最も単純な方法として等間隔サンプリングを用いるものとする。この場合、輪郭情報を点列として符号化した後、予め定められた間隔でその符号をサンプリングすることでサンプリング結果として制御点が得られる。   Finally, the sampling unit 242 uses equidistant sampling as the simplest method. In this case, after the contour information is encoded as a point sequence, the control point is obtained as a sampling result by sampling the code at a predetermined interval.

〈画像処理装置の機能ブロック図〉
図3は、本実施形態の画像処理装置の機能ブロック図である。図示のように、図2に示す処理に対応するように、解像度変換部32、色空間変換部33、領域分割部34、領域統合部36、輪郭抽出部37、サンプリング部38の各処理部と、ユーザとのインタラクションを行うためのユーザインタフェース31、画像等を保持するためのリポジトリ35からなる。ここでユーザインタフェース31は各処理部の制御も行う。
<Functional block diagram of image processing device>
FIG. 3 is a functional block diagram of the image processing apparatus according to the present embodiment. As shown in the figure, the processing units of the resolution conversion unit 32, the color space conversion unit 33, the region division unit 34, the region integration unit 36, the contour extraction unit 37, and the sampling unit 38 correspond to the processing shown in FIG. , A user interface 31 for interacting with the user, and a repository 35 for holding images and the like. Here, the user interface 31 also controls each processing unit.

〈画像処理装置のコンポーネントレベルの振る舞い〉
図4は、画像処理装置1のコンポーネントレベルの振る舞いを示すシーケンス図である。
<Component-level behavior of image processing device>
FIG. 4 is a sequence diagram showing the component level behavior of the image processing apparatus 1.

本実施形態における画像処理は、前記のとおり大きく分けるとROI候補領域抽出と、制御点生成処理からなる。ただし任意の入力画像を処理するために、多くの場合解像度変換や色空間変換などの前処理が必要になる。   Image processing in the present embodiment is roughly divided into ROI candidate region extraction and control point generation processing as described above. However, in order to process an arbitrary input image, preprocessing such as resolution conversion and color space conversion is often required.

まず前処理部22では、入力画像に対して解像度変換(S5)と色空間変換(S6)を行う。ここでは、ユーザインタフェース31に対する指示(S1)に基づいて、リポジトリ35から検索した画像を入力画像とする(S2〜S4)。   First, the preprocessing unit 22 performs resolution conversion (S5) and color space conversion (S6) on the input image. Here, based on an instruction (S1) to the user interface 31, an image searched from the repository 35 is set as an input image (S2 to S4).

入力画像Input_imageの解像度をx、予め定められた出力画像Output_imageの解像度をy、入力画像の高さheight、幅widthとすると、最も単純な解像度変換は、以下のように表される。ここで関数Avgは引数の平均を返すものである。   When the resolution of the input image Input_image is x, the resolution of the predetermined output image Output_image is y, the height of the input image is height, and the width is width, the simplest resolution conversion is expressed as follows. Here, the function Avg returns the average of the arguments.

Ratio = x/y
For i=0, i< height/Ratio
For j=0, j<width/Ratio
Output_image(i,j)=Avg(Input_image(ii,jj),height*Ratio<ii<(height+1)*Ratio,
width*Ratio<jj<(width+1)*Ratio)
なお、これ以外のサンプリング方法を用いて低解像度化を行ってもかまわない。
Ratio = x / y
For i = 0, i <height / Ratio
For j = 0, j <width / Ratio
Output_image (i, j) = Avg (Input_image (ii, jj), height * Ratio <ii <(height + 1) * Ratio,
width * Ratio <jj <(width + 1) * Ratio)
Note that the resolution may be reduced using a sampling method other than this.

本実施形態では、ROI候補領域抽出部23において領域成長法の一つであるウォーターシェッド法を利用する。この方法はグレースケール画像を入力画像として想定するため、色空間変換(S6)では、カラー画像からグレースケール画像への縮退を行うことが求められる。ただし、カラー画像をそのまま利用可能なウォーターシェッド法の派生法を用いる場合には、色空間変換は必要ない。RGBカラー画像からグレースケール画像への最も単純な変換は上記の仮定の下で以下のように示される。ここで関数R,G,Bはそれぞれ引数の画像情報の赤、緑、青成分を返すものである。   In the present embodiment, the ROI candidate region extraction unit 23 uses a watershed method that is one of region growth methods. Since this method assumes a grayscale image as an input image, in color space conversion (S6), it is required to perform degeneration from a color image to a grayscale image. However, color space conversion is not necessary when using a derivation method of the watershed method that can use a color image as it is. The simplest conversion from an RGB color image to a grayscale image is shown below under the above assumptions. Here, the functions R, G, and B return the red, green, and blue components of the image information of the argument, respectively.

For i=0, i<height
For j=0, j<width
Gray_scale_image(i, j) = 0.3 R(Input_image(i, j)) + 0.5 G(Input_image(i, j)) + 0.2 B(Input_image(i,
j))
For i = 0, i <height
For j = 0, j <width
Gray_scale_image (i, j) = 0.3 R (Input_image (i, j)) + 0.5 G (Input_image (i, j)) + 0.2 B (Input_image (i, j)
j))

低解像度化、色空間変換を受けた画像は、一旦途中生成画像(中間生成画像)としてリポジトリ35に保存される(S7、S8)。ただし、後段の全処理を通じてメモリ(RAM14)内で利用可能であればリポジトリ35に保存する必要はない。保存(書き込み)の終了がリポジトリ35から前処理部22に通知され(S9)、前処理の終了が前処理部22からユーザインタフェース31に通知される(S10)。   The image that has undergone the resolution reduction and color space conversion is temporarily stored in the repository 35 as an intermediate generated image (intermediate generated image) (S7, S8). However, if it can be used in the memory (RAM 14) through all subsequent processes, it is not necessary to store it in the repository 35. The end of storage (writing) is notified from the repository 35 to the preprocessing unit 22 (S9), and the end of preprocessing is notified from the preprocessing unit 22 to the user interface 31 (S10).

次にROI候補領域抽出部23では、ユーザインタフェース31に対する指示(S11)に基づいて、リポジトリ35から途中生成画像を検索し(S12〜S14)、領域の分割(S15)と主なオブジェクトに沿った領域の統合(S16)を行う。一般的に色や明度などの局所特徴に基づいた領域分割は、画像中の意味あるオブジェクトに対して過分割になりやすい。そのため局所特徴に基づいた領域分割の後、オブジェクトに沿って領域を統合する処理が必要となる。   Next, the ROI candidate area extraction unit 23 searches for a halfway generated image from the repository 35 based on an instruction to the user interface 31 (S11) (S12 to S14), and divides the area (S15) and follows the main object. Area integration (S16) is performed. In general, area division based on local features such as color and brightness tends to be over-division for meaningful objects in an image. For this reason, after region segmentation based on local features, a process of integrating regions along the object is required.

《領域分割処理の詳細》
領域分割処理(S15)は、前記のとおり局所特徴を利用した方法を用いる。これは画像の見えに近い領域分割結果を得るために必要である。図5は領域分割処理(S15)の詳細な機能ブロックであり、図6はその機能ブロックに対応するシーケンス図である。図5は、図3の領域分割部34に対応するものであり、処理制御部41、シード点配置部42、グラディエントマップ計算部43、グラディエント和計算部44、及び終了評価部45からなる。
<Details of area division processing>
The region dividing process (S15) uses a method using local features as described above. This is necessary in order to obtain a region segmentation result close to the appearance of the image. FIG. 5 is a detailed functional block of the area dividing process (S15), and FIG. 6 is a sequence diagram corresponding to the functional block. FIG. 5 corresponds to the area dividing unit 34 in FIG. 3 and includes a processing control unit 41, a seed point arrangement unit 42, a gradient map calculation unit 43, a gradient sum calculation unit 44, and an end evaluation unit 45.

図6に示すように、まずシード点配置部42が処理制御部41の指示に応じてシード点を配置してシード点情報を処理制御部41に渡し(S101〜S103)、次いでグラディエントマップ計算部43が処理制御部41の指示(S104)に応じてグラディエントマップを計算し(S105)、計算結果のグラディエントマップを処理制御部41に渡す(S106)。   As shown in FIG. 6, first, the seed point placement unit 42 places seed points according to an instruction from the processing control unit 41 and passes seed point information to the processing control unit 41 (S101 to S103), and then a gradient map calculation unit. 43 calculates a gradient map in accordance with an instruction (S104) from the process control unit 41 (S105), and passes the calculated gradient map to the process control unit 41 (S106).

次にグラディエント和計算部44が処理制御部41の指示(S107)に応じてグラディエント和を計算し(S108)、終了評価部45に終了条件のチェックを指示し(S109)、終了評価部45は終了条件をチェックした後に、終了通知を処理制御部41に送る(S110〜S111)。   Next, the gradient sum calculation unit 44 calculates the gradient sum in accordance with the instruction (S107) of the process control unit 41 (S108), instructs the end evaluation unit 45 to check the end condition (S109), and the end evaluation unit 45 After checking the end condition, an end notification is sent to the process control unit 41 (S110 to S111).

位置(i, j)におけるグラディエント場Grad(i, j)の計算(S108)を例えば以下のように行う。
For i=0, i<height
For j=0, j<width
Grad(i, j) = MAX(g(n))
For example, the gradient field Grad (i, j) at the position (i, j) is calculated (S108) as follows.
For i = 0, i <height
For j = 0, j <width
Grad (i, j) = MAX (g (n))

ここでg(n)は点i, jを中心とする局所窓の中での、中心からの勾配とし、nはその通し番号とし、1つの局所窓内で計算される勾配の総数をNとする。二次元画像の場合、Gradは、各点に対して方向を持つベクトルを与える。   Where g (n) is the gradient from the center in the local window centered at points i and j, n is its serial number, and N is the total number of gradients calculated in one local window. . For a two-dimensional image, Grad gives a vector with a direction for each point.

次に各点に定義されたグラディエント情報と、与えられたシード点情報を元に、領域を構成する。このときシード点はユーザが与えるものとするが、例えば予め定められた数のシード点をランダムに配置する方法などを採ってもよい。   Next, a region is constructed based on the gradient information defined for each point and the given seed point information. At this time, the seed points are given by the user. For example, a predetermined number of seed points may be randomly arranged.

ここでシード点の数をMとし、シード点mから成長した領域R(m)の隣接画素の集合をAdj_R(m)、隣接画素の総数をAとする。また、各シード点から輪郭各点までのグラディエント和Sum_Gradが最小となるパスをpに沿って以下のように計算する。関数MINは引数の最小値を返すものである。   Here, the number of seed points is M, the set of adjacent pixels in the region R (m) grown from the seed point m is Adj_R (m), and the total number of adjacent pixels is A. Further, a path along which the gradient sum Sum_Grad from each seed point to each contour point is minimized is calculated along p as follows. The function MIN returns the minimum value of the argument.

For m=0, m<M
For a=0, a<A
Sum_Grad(m, a) += MIN(Adj_Rm(m)(a))
For m = 0, m <M
For a = 0, a <A
Sum_Grad (m, a) + = MIN (Adj_Rm (m) (a))

この指標は、各シード点に対して隣接画素の数A個計算される。この方法で各シード点から領域成長を続ける。領域成長の終了条件は、他のシード点からの領域との接触であり、上記のグラディエント和を計算する過程で、単一の画素が複数のシード点からのパスに乗ったことを条件にして終了させることができる(S109、S110)。なお、図示を省略したが、領域分割処理済みの画像データは途中生成画像としてリポジトリ35に保存される。   This index is calculated for the number A of adjacent pixels for each seed point. In this way, region growth continues from each seed point. The region growth termination condition is contact with a region from another seed point, and it is a condition that a single pixel rides a path from a plurality of seed points in the above-described process of calculating the gradient sum. It can be terminated (S109, S110). Although illustration is omitted, the image data that has undergone the region division processing is stored in the repository 35 as an intermediately generated image.

《領域統合処理の詳細》
図7は領域統合処理(S16)の詳細な機能ブロックであり、図8はその機能ブロックに対応するシーケンス図である。図7は、図3の領域統合部36に対応するものであり、処理制御部51、色空間変換部52、平均色計算部53、統合クライテリア評価部54、及び領域統合部55からなる。
<Details of area integration processing>
FIG. 7 is a detailed functional block of the area integration process (S16), and FIG. 8 is a sequence diagram corresponding to the functional block. FIG. 7 corresponds to the region integration unit 36 of FIG. 3 and includes a processing control unit 51, a color space conversion unit 52, an average color calculation unit 53, an integrated criteria evaluation unit 54, and a region integration unit 55.

図8に示すように、色空間変換部52は処理制御部51からの色空間変換指示(S201)を受けると、リポジトリ35から領域分割済みの画像を検索・取得して入力画像とし(S202〜S204)、Lab色空間への色空間変換を行う(S205)。次いでLab色空間の入力画像を用いて領域統合を行い、統合結果を処理制御部51に渡す(S206〜S214)。   As shown in FIG. 8, when the color space conversion unit 52 receives a color space conversion instruction (S201) from the processing control unit 51, the color space conversion unit 52 searches and obtains an area-divided image from the repository 35 and uses it as an input image (S202˜). S204), color space conversion to Lab color space is performed (S205). Next, region integration is performed using the input image in the Lab color space, and the integration result is passed to the processing control unit 51 (S206 to S214).

この領域統合には様々な方法が利用できるが、代表的なものとしてスプリット・アンド・マージアルゴリズムの統合部分(マージ処理段)を用いることとする。スプリット・アンド・マージアルゴリズムのマージ処理段では、予め定められた統合指標を各領域に対して計算し、指標が近い近接領域を統合していくこと(この条件を統合クライテリアと呼ぶ)で過分割状態を緩和する。この統合クライテリアは自由に設定可能であるが、計算が収束するように統合の終了条件を設定する必要がある。   Various methods can be used for this region integration. As a typical example, the integration portion (merge processing stage) of the split and merge algorithm is used. In the merge processing stage of the split-and-merge algorithm, a predetermined integrated index is calculated for each area, and adjacent areas that are close to the index are integrated (this condition is referred to as an integrated criterion). Relieve the condition. The integration criteria can be freely set, but it is necessary to set the integration termination condition so that the calculation converges.

本実施形態では、統合指標として領域の平均色を利用し、近接領域間の統合指標の差が予め定められた閾値Tを下回る場合にはこれらの領域を統合する。平均色の差異を人間の知覚と近づけるために、平均色計算はLab色空間で行う。RGB色空間からLab色空間への変換(S205)は例えば「http://image-d.isp.jp/commentary/color_cformula/Lab.html」にある変換式を用いて計算することができる。   In the present embodiment, the average color of the areas is used as the integration index, and these areas are integrated when the difference of the integration index between the adjacent areas is below a predetermined threshold T. In order to make the average color difference closer to human perception, the average color calculation is performed in the Lab color space. The conversion from the RGB color space to the Lab color space (S205) can be calculated using a conversion formula in “http://image-d.isp.jp/commentary/color_cformula/Lab.html”, for example.

領域mのLab色空間における平均色をE(m)、領域mに属する画素の集合をS(m)とすると、各領域の平均色E(m)は、
For m=0, m<M
E(m) = Avg(S(m))
と表せる(S207)。
If the average color in the Lab color space of the region m is E (m) and the set of pixels belonging to the region m is S (m), the average color E (m) of each region is
For m = 0, m <M
E (m) = Avg (S (m))
(S207).

領域mに隣接する領域の集合をNeighbor(n)、領域mの隣接領域の総数をNとすると、
For m=0, m<M
For n=0, n<N
If (Diff (E(m)-Neighbor(n))<T)
Neighbor(n)を領域mに統合する(S210、S211)。ここで条件判定は統合クライテリア評価部54が行い、統合は領域統合部55が行う。
When Neighbor (n) is a set of areas adjacent to the area m and N is the total number of adjacent areas of the area m,
For m = 0, m <M
For n = 0, n <N
If (Diff (E (m) -Neighbor (n)) <T)
Neighbor (n) is integrated into the area m (S210, S211). Here, the condition determination is performed by the integrated criteria evaluation unit 54, and the integration is performed by the region integration unit 55.

各領域に領域番号を振り、領域に属する画素の属性の一つとして領域番号を保持することで、各画素の領域番号を修正することにより、上記統合過程を効率的に行うことができる。   By assigning an area number to each area and holding the area number as one of the attributes of the pixels belonging to the area, the area number of each pixel is corrected, whereby the integration process can be performed efficiently.

図4の説明に戻る。領域統合処理された画像は、ROI候補領域抽出部23によりリポジトリ35に途中生成画像として保存され(S17、S18)、保存(書き込み)の終了がリポジトリ35からROI候補領域抽出部23に通知され(S19)、ROI候補領域抽出処理の終了がROI候補領域抽出部23からユーザインタフェース31に通知される(S20)。   Returning to the description of FIG. The region-integrated image is stored as an intermediate generated image in the repository 35 by the ROI candidate region extraction unit 23 (S17, S18), and the completion of the storage (writing) is notified from the repository 35 to the ROI candidate region extraction unit 23 ( S19) The end of the ROI candidate area extraction process is notified from the ROI candidate area extraction unit 23 to the user interface 31 (S20).

次にユーザインタフェース31に対する制御点生成の指示(S21)に応じて、制御点生成部24がリポジトリ35から、ROI候補領域抽出部23により保存された途中生成画像を検索して取得する(S22〜S24)。次いで、取得した途中生成画像に対して、順次、輪郭抽出処理(S25)、サンプリング処理(S26)を施して制御点を生成する。そして、生成した制御点データをリポジトリ35に保存し、保存(書き込み)の完了をリポジトリ35が制御点生成部24に通知し(S27〜S29)、制御点生成処理の終了を制御点生成部24がユーザインタフェース31に通知する(S30)。   Next, according to the control point generation instruction (S21) to the user interface 31, the control point generation unit 24 searches the repository 35 for the intermediate generation image stored by the ROI candidate area extraction unit 23 and acquires it (S22 to S22). S24). Subsequently, a contour extraction process (S25) and a sampling process (S26) are sequentially performed on the acquired intermediate generation image to generate control points. Then, the generated control point data is stored in the repository 35, the repository 35 notifies the control point generation unit 24 of the completion of storage (writing) (S27 to S29), and the end of the control point generation processing is controlled by the control point generation unit 24. Notifies the user interface 31 (S30).

《制御点生成処理の詳細》
図9は制御点生成処理(S25、S26)の詳細な機能ブロックであり、図10はその機能ブロックに対応するシーケンス図である。図9は、図3の輪郭抽出部37、サンプリング部38及びリポジトリ35に対応するものであり、処理制御部61、境界抽出部62、サンプリング部63、及びリポジトリ35からなる。図9及び図10は、後述する等間隔サンプリング及び不等間隔サンプリングに共通である。
<Details of control point generation processing>
FIG. 9 is a detailed functional block of the control point generation process (S25, S26), and FIG. 10 is a sequence diagram corresponding to the functional block. FIG. 9 corresponds to the contour extraction unit 37, sampling unit 38, and repository 35 of FIG. 3, and includes a processing control unit 61, boundary extraction unit 62, sampling unit 63, and repository 35. 9 and 10 are common to equal interval sampling and unequal interval sampling which will be described later.

図10に示すように、まず処理制御部61はリポジトリ35からROI候補領域抽出部23により保存された途中生成画像を検索し、取得して入力画像とする(S301〜S303)。   As shown in FIG. 10, first, the processing control unit 61 searches the repository 35 for an intermediate generated image stored by the ROI candidate region extraction unit 23, acquires it, and uses it as an input image (S301 to S303).

次いで境界抽出部62が処理制御部61の指示に基づいて、ROI候補領域の境界抽出を行い、境界情報を処理制御部61に渡す(S304〜S306)。最後にサンプリング部63が処理制御部61の指示に基づいて、境界情報のサンプリングを行って制御点を生成し、制御点情報を処理制御部61に渡す(S307〜S309)。   Next, the boundary extraction unit 62 performs boundary extraction of the ROI candidate region based on the instruction from the processing control unit 61, and passes the boundary information to the processing control unit 61 (S304 to S306). Finally, the sampling unit 63 samples boundary information based on an instruction from the processing control unit 61 to generate control points, and passes the control point information to the processing control unit 61 (S307 to S309).

ここでS304〜S309はROI候補領域の数だけ反復する。また、S307のサンプリングでは、等間隔サンプリング、不等間隔サンプリングのどちらかを行うように、予めユーザインタフェース31から設定することができる。   Here, S304 to S309 are repeated by the number of ROI candidate areas. Further, in the sampling of S307, it can be set in advance from the user interface 31 so as to perform either uniform sampling or nonuniform sampling.

各ROI候補領域の境界情報(輪郭についての点群情報)のデータ構造例を下記の表1に示す。ここで、X座標位置、Y座標位置は、各ROI候補領域の輪郭である連続線を横方向(X軸方向)、縦方向(Y軸方向)に所定の間隔でサンプリングした点、換言すれば、ROI候補領域の輪郭に格子を重ねたときの輪郭上の格子点の座標である。   Table 1 below shows an example of the data structure of the boundary information (point group information about the contour) of each ROI candidate region. Here, the X coordinate position and the Y coordinate position are points obtained by sampling a continuous line that is an outline of each ROI candidate region in the horizontal direction (X-axis direction) and the vertical direction (Y-axis direction) at predetermined intervals, in other words. , The coordinates of lattice points on the contour when the lattice is superimposed on the contour of the ROI candidate area.

Figure 2012194919
Figure 2012194919

等間隔サンプリングの場合には、上記データの内、点列を等間隔にサンプリングすることで結果が得られる。この場合最終的に得られる輪郭上の点情報がそのまま制御点情報となるため、制御点のデータ構造も表1に準ずるものとする。   In the case of equidistant sampling, a result is obtained by sampling a point sequence at regular intervals in the above data. In this case, since the point information on the contour finally obtained becomes the control point information as it is, the data structure of the control point is also based on Table 1.

次に不等間隔サンプリングであるが、サンプリングを不等間隔にする理由は前記のとおりオブジェクトの複雑さに従い、変化の少ない部分には少ない制御点を、変化の多い部分には多くの制御点を割り当てるためである。   Next, unequal interval sampling, the reason for unequal interval sampling depends on the complexity of the object as described above, with fewer control points for parts with little change and many control points for parts with much change. It is for assigning.

不等間隔サンプリングの一例として、以下の様なサンプリング方法を用いる。
点列情報が表1のように与えられた場合、各点における変化量は微分値(線微分)を用いて表すことができる。ここで、隣り合う2個の点の間のX座標位置の変化がΔX、Y座標位置の変化がΔYの場合、
√{(ΔX)+(ΔY)
により微分値を算出する。つまり、差分により近似する。
As an example of unequal interval sampling, the following sampling method is used.
When the point sequence information is given as shown in Table 1, the amount of change at each point can be expressed using a differential value (line differential). Here, when the change in the X coordinate position between two adjacent points is ΔX and the change in the Y coordinate position is ΔY,
√ {(ΔX) 2 + (ΔY) 2 }
The differential value is calculated by That is, it approximates by the difference.

次に輪郭に沿った微分値の加重移動平均を求める。この加重移動平均を求めるための局所窓の大きさは予め与えておく。加重移動平均値の算出に用いる関数の一例を図11に示す。この例は、ターゲット点(ターゲット(処理対象)となるデータ点)からの距離に応じて加重がリニアに減少する関数である。   Next, a weighted moving average of differential values along the contour is obtained. The size of the local window for obtaining this weighted moving average is given in advance. An example of a function used for calculating the weighted moving average value is shown in FIG. This example is a function in which the weight decreases linearly according to the distance from the target point (data point that is the target (processing target)).

通常の平均と異なり、加重移動平均はターゲット点からの距離に従い重み付け係数が減少するため、遠方のデータ点からの影響を小さく抑えることができる。これにより、ROI候補領域の輪郭の微分値の平均を計算するための局所窓外周部に、微分値の大きな点が入ってきた瞬間の平均値の急激な増大を防ぎ、より実際的な微分平均値の算出が可能となる。   Unlike the normal average, the weighted moving average decreases the weighting coefficient in accordance with the distance from the target point, so that the influence from a distant data point can be suppressed small. This prevents a sudden increase in the average value at the moment when a point having a large differential value enters the local window outer periphery for calculating the average of the differential value of the contour of the ROI candidate region, and a more practical differential average. The value can be calculated.

この加重移動平均Avg_dが予め定められた閾値THを上回る場合には、その点をサンプリングして制御点とする。このためのデータ構造例を表2に示す。THは予め与えられた固定値を用いてもよいし、THをパラメータとして変化させ、制御点の数が一定になるまでTHを降下させ、サンプリング処理を繰り返すことで、予め定められた制御点数を満たすサンプリング結果を得ることもできる。以上の処理により、輪郭曲線の複雑さに適応した制御点を生成することができる。   If this weighted moving average Avg_d exceeds a predetermined threshold TH, that point is sampled as a control point. An example data structure for this is shown in Table 2. A fixed value given in advance may be used, or TH is changed as a parameter, TH is lowered until the number of control points becomes constant, and the sampling process is repeated to obtain a predetermined number of control points. Satisfactory sampling results can also be obtained. With the above processing, control points adapted to the complexity of the contour curve can be generated.

Figure 2012194919
Figure 2012194919

〔輪郭を分割して生成した部分輪郭に対する制御点の生成〕
本実施形態では、輪郭曲線の複雑さに適応した制御点を生成する際、輪郭を分割して部分輪郭を生成し、部分輪郭に対してサンプリングを行って、等間隔サンプリングもしくは不等間隔サンプリングの制御点を生成する。
[Generation of control points for partial outlines generated by dividing outlines]
In this embodiment, when generating a control point adapted to the complexity of the contour curve, the contour is divided to generate a partial contour, and sampling is performed on the partial contour to perform sampling at equal intervals or unequal intervals. Generate control points.

図12は、この制御点生成処理の一例を示すフローチャートである。この処理は図10におけるサンプリング部63が実行する。図12に示すように、ROI候補領域の境界情報を基に、ROI候補領域の輪郭を分割して、部分輪郭を生成する(ST1)。なお、輪郭を分割する方法については後述する。   FIG. 12 is a flowchart showing an example of the control point generation process. This processing is executed by the sampling unit 63 in FIG. As shown in FIG. 12, based on the boundary information of the ROI candidate area, the outline of the ROI candidate area is divided to generate a partial outline (ST1). A method for dividing the contour will be described later.

次いで、部分輪郭の一つ(s=1)をターゲットとして選択し(ST2)、その部分輪郭上の一点を部分輪郭開始地点とし(ST3)、その点をターゲット点にするとともに、ターゲット点における部分輪郭上の微分値を計算する(ST4)。   Next, one of the partial contours (s = 1) is selected as a target (ST2), one point on the partial contour is set as a partial contour start point (ST3), the point is set as a target point, and a portion at the target point is selected. A differential value on the contour is calculated (ST4).

次にターゲット点における微分値の加重移動平均値を計算し(ST5)、計算結果が閾値THを上回るか否かを判断する(ST6)。そして、上回ると判断した場合は(ST6:Yes)、そのターゲット点を制御点に指定し(ST7)、上回らないと判断した場合は(ST6:No)、そのターゲット点を制御点に指定しない(ST8)。   Next, the weighted moving average value of the differential value at the target point is calculated (ST5), and it is determined whether or not the calculation result exceeds the threshold value TH (ST6). If it is determined that the target point is exceeded (ST6: Yes), the target point is designated as a control point (ST7). If it is determined not to exceed (ST6: No), the target point is not designated as a control point (ST6). ST8).

部分輪郭(s=1)の終了点に到達するまでターゲット点を移して(ST9:No→ST10)、ST4〜ST8を反復する。終了点に到達したら(ST9:Yes)、全ての部分輪郭を処理するまで次の部分輪郭を選択し(ST11→ST12:No)、ST3〜ST11を反復する。一つの輪郭の全ての部分輪郭を処理したら(ST12:Yes)、ターゲットを次の輪郭に移して(ST13:No→ST14)、ST1から実行する。全ての輪郭の処理を終了したら(ST13:Yes)、この図の処理を終了させる。
以上の処理により、各部分輪郭に対して、形状の複雑さに適応した制御点を生成することができる。
The target point is moved until the end point of the partial contour (s = 1) is reached (ST9: No → ST10), and ST4 to ST8 are repeated. When the end point is reached (ST9: Yes), the next partial contour is selected until all the partial contours are processed (ST11 → ST12: No), and ST3 to ST11 are repeated. When all the partial contours of one contour have been processed (ST12: Yes), the target is moved to the next contour (ST13: No → ST14) and executed from ST1. When the processing of all the contours is completed (ST13: Yes), the processing of this figure is terminated.
Through the above processing, control points adapted to the complexity of the shape can be generated for each partial contour.

図13は、部分輪郭に対してサンプリングを行って制御点を生成する処理の別の一例を示すフローチャートである。このフローでは、各部分輪郭に対してそれぞれ等間隔サンプリングを行うか不等間隔サンプリングを行うかを決定するため、まず各部分輪郭に対して、輪郭形状の微分値の平均値avg_dと標準偏差値std_dを指標として求める。そのため、等間隔サンプリング、不等間隔サンプリングとこれらの指標との関係を予め実験により導出しておく。今回の場合、指標が2つあるため、表3のように2次元の表として、定義することができる。この表において、avg_d及びstd_dはそれぞれ0から100の間の値に正規化されている。同様に3つ以上の指標を用いる場合にも、対応した次元の表を作成することで対応できる。   FIG. 13 is a flowchart showing another example of processing for generating a control point by sampling a partial contour. In this flow, in order to decide whether to perform equal interval sampling or unequal interval sampling for each partial contour, first, for each partial contour, the average value avg_d and the standard deviation value of the differential value of the contour shape Obtain std_d as an index. Therefore, the relationship between equal interval sampling and unequal interval sampling and these indexes is derived in advance by experiments. In this case, since there are two indexes, it can be defined as a two-dimensional table as shown in Table 3. In this table, avg_d and std_d are each normalized to a value between 0 and 100. Similarly, the case where three or more indices are used can be dealt with by creating a table of corresponding dimensions.

Figure 2012194919
Figure 2012194919

図13に示すように、ROI候補領域の境界情報を基に、ROI候補領域の輪郭を分割して、部分輪郭を生成する(ST101)。次いで、部分輪郭の一つをターゲットとして選択し、その部分輪郭上の一点を部分輪郭開始地点とし(ST102)、その点をターゲット点にするとともに、ターゲット点における輪郭上の微分値を計算する(ST103)。   As shown in FIG. 13, based on the boundary information of the ROI candidate area, the outline of the ROI candidate area is divided to generate a partial outline (ST101). Next, one of the partial contours is selected as a target, one point on the partial contour is set as a partial contour start point (ST102), the point is set as a target point, and a differential value on the contour at the target point is calculated ( ST103).

部分輪郭の終了点に到達するまでターゲット点を移して(ST104:No→ST105)、ST103を反復し、部分輪郭の終了点に到達したら(ST104:Yes)、ターゲットとした部分輪郭全体の微分値の平均値avg_dを算出し(ST106)、さらにターゲットとした部分輪郭全体の微分値の標準偏差値std_dを算出する(ST107)。次に平均値avg_d及び標準偏差値std_d、並びに表3を基に等間隔サンプリングにするか不等間隔サンプリングにするかを決定する(ST108)。   The target point is moved until the end point of the partial contour is reached (ST104: No → ST105), ST103 is repeated, and when the end point of the partial contour is reached (ST104: Yes), the differential value of the entire target partial contour is obtained. Is calculated (ST106), and a standard deviation value std_d of the differential value of the entire target partial contour is calculated (ST107). Next, based on the average value avg_d and the standard deviation value std_d and Table 3, it is determined whether to perform equal interval sampling or unequal interval sampling (ST108).

全て部分輪郭の処理を終了するまで処理対象(ターゲット)の部分輪郭を移して(ST109:No→ST110)、部分輪郭毎に上記のステップ(ST102〜ST108)を実行し、全ての部分輪郭の処理を終了したら(ST109:Yes)、この図の処理を終了させる。   The partial contour of the processing target (target) is moved until the processing of all partial contours is completed (ST109: No → ST110), and the above steps (ST102 to ST108) are executed for each partial contour to process all partial contours. Is completed (ST109: Yes), the processing in this figure is terminated.

以上の処理により、画像内の各ROI候補領域の各部分輪郭に対して、それぞれの微分値の平均値及び標準偏差値を基に等間隔サンプリングを行うか不等間隔サンプリングを行うかを決定することで、部分輪郭の形状の複雑さに応じて適応的に制御点を生成することができる。   With the above processing, it is determined whether to perform equal interval sampling or unequal interval sampling for each partial contour of each ROI candidate region in the image based on the average value and standard deviation value of each differential value. Thus, control points can be adaptively generated according to the complexity of the shape of the partial contour.

〔輪郭の分割処理〕
図12のST1及び図13のST101における輪郭分割処理のうち、最も単純な処理は等間隔に輪郭を分割することである。これは計算が簡単・軽量である反面、輪郭区間が適切に設定されないことにより、後処理(サンプリング方法の決定)に影響を与えることがある。この影響を軽減するために輪郭分割を適応的に行うことが有効である。本実施形態の目的はサンプリング方法とサンプリング間隔を適当に設定することにより、全体の制御点の個数を減らし、後段の輪郭追従、輪郭調整処理段を高速化することであるので、制御点の個数を低減可能な直線性の高い領域を独立した輪郭区間として分割する方が望ましい。
[Outline division processing]
Of the outline dividing processes in ST1 of FIG. 12 and ST101 of FIG. 13, the simplest process is to divide the outline at equal intervals. While this is simple and lightweight, it may affect post-processing (sampling method determination) because the contour section is not set appropriately. In order to reduce this influence, it is effective to perform contour division adaptively. The purpose of this embodiment is to set the sampling method and sampling interval appropriately, thereby reducing the number of overall control points and speeding up the subsequent contour tracking and contour adjustment processing stages. It is desirable to divide a region with high linearity that can be reduced as an independent contour section.

そこで、ハフ変換を用いることで、輪郭を、原点からの距離及び角度の2次元に置き換え、ハフ平面内のピークを検出することで、輪郭の直線性の高い部分を抽出する。一般にハフ変換は背景雑音に対する感度が高いが、今回のように輪郭が抽出されている場合には背景雑音の影響を受けないため、直線性の高い輪郭区間を高精度に抽出することができる。   Therefore, by using the Hough transform, the contour is replaced with a two-dimensional distance and angle from the origin, and a peak in the Hough plane is detected to extract a portion having a high linearity of the contour. In general, the Hough transform has a high sensitivity to background noise. However, when the contour is extracted as in this case, it is not affected by the background noise, so that a highly linear contour section can be extracted with high accuracy.

ただし、ハフ平面のピーク値は、原点からの距離と角度を表しているだけであるため、これら二つの情報だけでは輪郭の直線性の高い部分を抽出することはできない。そのため、本実施形態では、以下に示す処理により直線性の高い輪郭区間の抽出を行う。   However, since the peak value of the Hough plane only represents the distance and angle from the origin, it is not possible to extract a highly linear portion of the contour using only these two pieces of information. For this reason, in the present embodiment, a highly linear contour section is extracted by the following process.

図14は、この処理、即ちハフ変換を用いた輪郭分割処理を示すフローチャートである。また、図15は、ハフ変換を用いた輪郭分割処理を説明するための図であり、図16は、ハフ変換を用いた輪郭分割処理により実行される輪郭からの直線区間の抽出を説明するための図であり、図17は、ハフ変換を用いた輪郭分割処理において抽出される可能性のある擬似直線を示す図である。   FIG. 14 is a flowchart showing this process, that is, the contour division process using the Hough transform. FIG. 15 is a diagram for explaining the contour division processing using the Hough transform, and FIG. 16 is a diagram for explaining the extraction of the straight line section from the contour executed by the contour division processing using the Hough transform. FIG. 17 is a diagram illustrating a pseudo line that may be extracted in the contour dividing process using the Hough transform.

図14に示すように、フラグ関数fを初期化する(ST201)。フラグ関数fは輪郭点sが候補であるか否かを示す関数であり、候補である場合には1を、そうでない場合には0をとる。引数のs及びtは、ループが異なるために変えているだけで本質的には違いはない。ST201では、全てのsに対してf(s)=0とする。   As shown in FIG. 14, the flag function f is initialized (ST201). The flag function f is a function indicating whether or not the contour point s is a candidate, and takes 1 if it is a candidate and 0 otherwise. The arguments s and t are essentially the same as they are changed because the loops are different. In ST201, f (s) = 0 is set for all s.

次に、図14及び図15に示すように、輪郭をハフ変換し(ST202)、ハフ平面におけるピーク値(r, Θ)を検出する(ST203)。このピーク値は実平面では一つの直線を表すため、ハフ平面のピーク値を高い順にn個とることは、実平面における直線をn個とることに相当する。これらは輪郭の直線近似として、適当なn個の直線となっている。   Next, as shown in FIGS. 14 and 15, the contour is subjected to Hough transform (ST202), and the peak value (r, Θ) in the Hough plane is detected (ST203). Since this peak value represents one straight line on the real plane, taking n peak values on the Hough plane in descending order is equivalent to taking n straight lines on the real plane. These are appropriate n straight lines as a linear approximation of the contour.

次に各直線に対して、輪郭上の各点からの距離(垂線距離)をとり(ST204、ST205)、この垂線距離が予め定められた閾値TH1よりも小さい点を、直線区間候補とする(ST206:Yes→ST207)。   Next, a distance (perpendicular distance) from each point on the contour is taken for each straight line (ST204, ST205), and a point where this perpendicular distance is smaller than a predetermined threshold TH1 is set as a straight section candidate ( ST206: Yes → ST207).

輪郭上の各点を順に検査し、直線区間候補となっている点の連続区間が予め定められた閾値TH2よりも大きくなっている場合には、その連続区間を輪郭区間として採用する(ST207〜ST215)。   Each point on the contour is inspected in order, and if the continuous section of the points that are straight line section candidates is larger than the predetermined threshold TH2, the continuous section is adopted as the contour section (ST207- ST215).

実際には図16に示すように、変換後のピーク値から導出される直線と、輪郭を比較し、その直線からの垂直距離Dが閾値TH1以下の輪郭範囲を直線区間の候補とする。輪郭上の各点を順に検査し、直線区間候補となっている点の連続区間が予め定められた閾値TH2よりも大きくなっている場合には、その連続区間を輪郭区間として採用する。これにより図17に示されるような疑似直線の検出を避けることができる。   Actually, as shown in FIG. 16, the straight line derived from the converted peak value is compared with the contour, and a contour range whose vertical distance D from the straight line is equal to or less than a threshold TH1 is set as a candidate for a straight section. Each point on the contour is inspected in order, and when the continuous section of the point that is a straight section candidate is larger than a predetermined threshold TH2, the continuous section is adopted as the contour section. Thereby, the detection of the pseudo straight line as shown in FIG. 17 can be avoided.

本実施形態によれば、抽出対象のオブジェクト輪郭を部分輪郭に分割し、各部分輪郭に対して等間隔サンプリングか不等間隔サンプリングかを決めることで、輪郭上により高精度に制御点を配置することができる。具体的には直線性の高い部分輪郭に対しては間隔の広い等間隔サンプリングを行い、込み入った曲線部に関しては適応的にサンプリング間隔を決定する不等間隔サンプリングを適用することで、輪郭全体の制御点の数を減らしつつ、込み入った曲線部に関しても輪郭形状に対する追従性を確保することができる。   According to the present embodiment, the object contour to be extracted is divided into partial contours, and the control points are arranged on the contour with higher accuracy by determining whether each partial contour is sampled at equal intervals or at irregular intervals. be able to. Specifically, uniform sampling with a wide interval is performed for partial contours with high linearity, and unequal interval sampling for adaptively determining the sampling interval is applied to complicated curved portions, thereby While reducing the number of control points, it is possible to ensure followability with respect to the contour shape even with respect to complicated curved portions.

[第2の実施形態]
〈実施形態全体の概要〉
本実施形態におけるシステム構成は第1の実施形態と同様である。即ち、第1の実施形態の図1、図2は本実施形態と共通である。また、本実施形態の画像処理装置の機能ブロック、そのコンポーネントレベルの振る舞いは、それぞれ図3、図4と同様である。
[Second Embodiment]
<Overview of overall embodiment>
The system configuration in this embodiment is the same as that in the first embodiment. That is, FIGS. 1 and 2 of the first embodiment are common to the present embodiment. Further, the functional blocks of the image processing apparatus according to the present embodiment and the behaviors at the component level are the same as those in FIGS. 3 and 4, respectively.

本実施形態は、入力画像中の複数の輪郭を検出し、各輪郭に対して最適な制御点の配置を行うためのシステムである。本実施形態では、ROI候補領域抽出部をスプリット・アンド・マージアルゴリズム(領域分割統合法)を用いて行う。スプリット・アンド・マージアルゴリズムは、最終的に少数の領域のみを与える方式であるため、これらの領域からオブジェクトとして抽出するべき領域を選択する処理が別途必要になる。   The present embodiment is a system for detecting a plurality of contours in an input image and arranging optimal control points for each contour. In this embodiment, the ROI candidate area extraction unit is performed using a split-and-merge algorithm (area division integration method). Since the split-and-merge algorithm is a method that finally gives only a small number of areas, a process for selecting an area to be extracted as an object from these areas is separately required.

スプリット・アンド・マージアルゴリズムは周知であるから、ここでは概略のみを説明する。スプリット・アンド・マージアルゴリズムは、領域の分割を行うスプリット処理段と、統合を行うマージ処理段からなる。   Since the split and merge algorithm is well known, only the outline will be described here. The split-and-merge algorithm includes a split processing stage for dividing an area and a merge processing stage for integration.

スプリット処理段では、予め定められた指標に基づき、領域を再帰的に分割する。殆どの場合この処理段での分割は過分割(最終的な分割結果よりも過度に領域が分割されている状態)となる。再帰的分割処理を停止する条件としては、ターゲット領域内部の均一性指標の閾値処理によることが多い。また均一でないと判定された領域の分割方式に関しても多くの研究があるが、殆どの例では単純な分割方法で十分であり、四分割で実装している例が多い。   In the split processing stage, the region is recursively divided based on a predetermined index. In most cases, the division at this processing stage is overdivision (a state where the area is divided excessively than the final division result). The condition for stopping the recursive division processing is often based on threshold processing of the uniformity index inside the target area. There are many studies on the method of dividing the area determined to be non-uniform, but in most cases, a simple division method is sufficient, and there are many examples implemented in four divisions.

スプリット処理段で過分割された領域情報を元に、マージ処理段では領域の統合を行い、最終的な領域分割結果を得る。マージ処理段はスプリット処理段に比べ技術的な難易度が高いが、処理全体の性能の決定要因となる重要な処理段である。一般的にはスプリット処理段と同じく、均一性指標を用いて隣接領域の統合を行う。   Based on the area information that has been over-divided in the split processing stage, the merge process stage integrates the areas to obtain the final area division result. The merge processing stage is technically difficult compared to the split processing stage, but is an important processing stage that becomes a determinant of the performance of the entire process. Generally, as in the split processing stage, adjacent regions are integrated using a uniformity index.

例えば領域の平均色を均一性尺度とし、平均色間の差異の大小により領域の統合を決める方式の場合、例えばターゲット領域の隣接領域を平均色の順にスタックにため、スタック上位の隣接領域から順にターゲット領域との統合の可否を判定することで領域の統合を行うことができる。この方式の場合画像内のどの領域からマージ処理を開始するかで結果が異なる場合があるが、例えば画像左上から処理を開始すると予め決めておくことで、処理の一貫性を保つことができる。   For example, when the average color of the area is used as a uniformity scale and the area integration is determined by the difference between the average colors, the adjacent areas of the target area are stacked in the order of the average color, for example, in order from the adjacent area in the top of the stack. By determining whether or not integration with the target area is possible, the areas can be integrated. In this method, the result may differ depending on which region in the image the merge process is started from. However, for example, by determining in advance that the process is started from the upper left of the image, the consistency of the process can be maintained.

最も単純な方法は、画像中心に抽出するべきオブジェクトが存在すると仮定し、中心からの距離が最も小さい領域をROI候補領域とする方法である。他にも抽出すべきオブジェクトが決まっている場合には、類似画像領域検索機能を利用することで、大まかなROI候補領域を抽出することが可能である。   The simplest method is a method that assumes that there is an object to be extracted at the center of the image, and sets the region having the smallest distance from the center as the ROI candidate region. When other objects to be extracted are determined, a rough ROI candidate region can be extracted by using a similar image region search function.

画像中に多数のオブジェクトが存在する場合、各個にサンプリング方法を決めることもできるが計算量が多くなる。例えばガラス面に水滴が多数あるような例を考えたとき、全ての水滴に対してサンプリング方法決定のための処理を施すのは計算量が増えるため望ましくない。水滴の形状の類似性を考えると、代表的な水滴でサンプリング方法を決定し、それに基づいて画像全体を処理するのが適当である。その場合、代表的なオブジェクトをどのように見つけるかが重要である。最も単純には、画像中心に最も重要なオブジェクトが存在すると仮定し、そのオブジェクトのサンプリング方法を、他のオブジェクトでも利用する方法が考えられる。画像中心への近さに関しても様々な計算方法があり得るが、例えば、予備的に画像を分割し、各領域の重心を計算し、画像中心から最も近い重心を持つ領域を代表的なオブジェクトとして利用する方法がある。   If there are many objects in the image, the sampling method can be determined for each object, but the amount of calculation increases. For example, when considering an example in which there are many water droplets on the glass surface, it is not desirable to perform processing for determining the sampling method for all the water droplets because the calculation amount increases. Considering the similarity of the shape of the water droplets, it is appropriate to determine the sampling method for a typical water droplet and to process the entire image based on it. In that case, how to find a representative object is important. In the simplest case, it is assumed that the most important object exists at the center of the image, and the method of sampling the object can be used for other objects. There are various calculation methods for the proximity to the image center.For example, the image is preliminarily divided, the center of gravity of each region is calculated, and the region having the center of gravity closest to the image center is used as a representative object. There are ways to use it.

〈制御点生成処理の詳細〉
1枚の画像の中にある複数の輪郭の制御点のサンプリング方法及びサンプリング間隔を決定するための方法として、第1〜第3の方法を提案する。
<Details of control point generation processing>
The first to third methods are proposed as a sampling method for a plurality of contour control points in one image and a method for determining a sampling interval.

《画像の中心に最も近い輪郭の評価値に基づく画像中の全輪郭のサンプリング》
第1の方法では、1枚の画像の中にある複数の輪郭の内、特定の一つの輪郭として、画像の中心に最も近い輪郭を設定し、その輪郭の評価結果を用いて画像全体のサンプリング方法を決定する。つまり、画像中央に重要な領域があると仮定し、画像の中心に最も近い輪郭の評価結果を用いて画像全体のサンプリング方法を決定する。
<< Sampling of all contours in the image based on the evaluation value of the contour closest to the center of the image >>
In the first method, a contour closest to the center of the image is set as a specific contour among a plurality of contours in one image, and the entire image is sampled using the contour evaluation result. Decide how. That is, assuming that there is an important region in the center of the image, the sampling method for the entire image is determined using the evaluation result of the contour closest to the center of the image.

図18は、この方法の手順である画像の中心に重心が最も近い輪郭を検出する処理を示すフローチャートである。
まず、画像中の輪郭抽出処理(ST301)、最短重心距離Dminの初期化及び代表値Rの初期化(ST302)の後に輪郭番号sを初期化する(ST303)。
FIG. 18 is a flowchart showing a process of detecting a contour whose center of gravity is closest to the center of an image, which is a procedure of this method.
First, the contour number s is initialized (ST303) after contour extraction processing (ST301) in the image, initialization of the shortest centroid distance Dmin and initialization of the representative value R (ST302).

次いで、輪郭sの中心と画像の中心との間の距離D(s)を計算し(ST304)、計算結果がDminの初期値より小さい場合(ST305:Yes)、Dmin=D(s)とするとともに、輪郭sを代表値Rとする(ST306)。   Next, the distance D (s) between the center of the contour s and the center of the image is calculated (ST304). If the calculation result is smaller than the initial value of Dmin (ST305: Yes), Dmin = D (s) is set. At the same time, the contour s is set as a representative value R (ST306).

輪郭番号をインクリメントし(ST307)、全ての輪郭に対してST304〜ST307を反復することにより、Dminを与える輪郭Rを代表値として設定する(ST308:Yes→ST309)。   The contour number is incremented (ST307), and by repeating steps ST304 to ST307 for all the contours, the contour R giving Dmin is set as a representative value (ST308: Yes → ST309).

このように、輪郭抽出処理(ST301)により全ての輪郭を抽出し、その後の処理として、各領域(境界に囲まれる範囲)の重心を計算し、画像中心から重心までの距離が一番小さい輪郭Rを、代表的な輪郭として選択する。   In this way, all the contours are extracted by the contour extraction process (ST301), and as a subsequent process, the center of gravity of each region (range surrounded by the boundary) is calculated, and the contour having the smallest distance from the center of the image to the center of gravity is calculated. R is selected as a representative contour.

画像を代表する輪郭として画像の中心に重心が最も近い輪郭Rを設定したら、図19に示す処理により画像中の全ての輪郭のサンプリング間隔を決定する。   When the contour R having the closest center of gravity to the center of the image is set as the contour representing the image, the sampling interval of all the contours in the image is determined by the processing shown in FIG.

この図の処理では、画像を代表する輪郭に対して、輪郭形状の微分値の平均値avg_dと標準偏差値std_dを指標として求める。そのため、サンプリング間隔とこれらの指標との関係を予め実験により導出し、表4のように2次元の表として、サンプリング間隔を定義しておく。同様に3つ以上の指標を用いる場合にも、対応した次元の表を作成することで対応できる。avg_d及びstd_dはそれぞれ0から100の間の値に正規化されている。   In the process of this figure, the average value avg_d and standard deviation value std_d of the differential values of the contour shape are obtained as indices for the contour representing the image. Therefore, the relationship between the sampling interval and these indices is derived in advance by experiments, and the sampling interval is defined as a two-dimensional table as shown in Table 4. Similarly, the case where three or more indices are used can be dealt with by creating a table of corresponding dimensions. avg_d and std_d are each normalized to a value between 0 and 100.

Figure 2012194919
Figure 2012194919

図示のように、画像を代表する輪郭をターゲット輪郭とし、その一点を輪郭開始地点(最初のターゲット点)とし(ST401)、そのターゲット点における輪郭上の微分値を計算する(ST402)。輪郭を一周するまでターゲット点を移して(ST403:No→ST404)、ST402を反復し、輪郭を一周したら(ST403:Yes)、画像を代表する輪郭全体の微分値の平均値avg_dを算出し(ST405)、さらにターゲット輪郭全体の微分値の標準偏差値std_dを算出する(ST406)。次に平均値avg_d及び標準偏差値std_d、並びに表4を基に等間隔サンプリングの間隔を決定する(ST407)。   As shown in the figure, a contour representing an image is set as a target contour, one point thereof is set as a contour start point (first target point) (ST401), and a differential value on the contour at the target point is calculated (ST402). The target point is moved until it goes around the contour (ST403: No → ST404), ST402 is repeated, and the contour goes around (ST403: Yes), and the average value avg_d of the differential value of the entire contour representing the image is calculated ( ST405) Further, a standard deviation value std_d of the differential value of the entire target contour is calculated (ST406). Next, based on the average value avg_d and the standard deviation value std_d and Table 4, the interval of equal interval sampling is determined (ST407).

以上の処理により、画像を代表する輪郭である画像の中心に最も近い重心を持つ輪郭の微分値の平均値及び標準偏差値を基に、画像中の全ての輪郭に対して、等間隔サンプリングのための間隔を与えることができる。   Based on the above processing, equidistant sampling is performed on all contours in the image based on the average value and standard deviation value of the differential value of the contour having the center of gravity closest to the center of the image, which is the contour representing the image. Can be given an interval for.

《画像中で最長の輪郭の評価値に基づく画像中の全輪郭のサンプリング》
第2の方法では、1枚の画像の中にある複数の輪郭の内、特定の一つの輪郭として、長さが最大の輪郭を選択し、その輪郭の評価結果を用いて画像全体のサンプリング方法を決定する。
<< Sampling of all contours in the image based on the evaluation value of the longest contour in the image >>
In the second method, a contour having the maximum length is selected as a specific one of a plurality of contours in one image, and the entire image is sampled using the evaluation result of the contour. To decide.

図20は、この方法の処理手順を示すフローチャートである。
図示のように、画像中の輪郭抽出処理(ST501)、最長輪郭長Lmaxの初期化及び代表値Rの初期化(ST502)の後に輪郭番号sを初期化する(ST503)。
FIG. 20 is a flowchart showing the processing procedure of this method.
As shown in the figure, the contour number s is initialized (ST503) after contour extraction processing (ST501) in the image, initialization of the longest contour length Lmax and initialization of the representative value R (ST502).

次いで、輪郭sの輪郭長L(s)を計算し(ST504)、計算結果がLmaxの初期値より大きい場合(ST505:Yes)、Lmax=L(s)とするとともに、輪郭sを代表値Rとする(ST506)。   Next, the contour length L (s) of the contour s is calculated (ST504). When the calculation result is larger than the initial value of Lmax (ST505: Yes), Lmax = L (s) and the contour s is represented by the representative value R. (ST506).

輪郭番号をインクリメントし(ST507)、全ての輪郭に対してST504〜ST507を反復することにより、Lmaxを与える輪郭Rを代表値として設定する(ST508:Yes→ST509)。   The contour number is incremented (ST507), and by repeating steps ST504 to ST507 for all the contours, the contour R giving Lmax is set as a representative value (ST508: Yes → ST509).

《画像中の全輪郭を一体とみなした評価値に基づくサンプリング》
第3の方法では、画像中の全ての輪郭を一体とみなして評価することで、全ての輪郭に共通するサンプリング間隔を決める。
《Sampling based on evaluation value considering all contours in the image as one unit》
In the third method, the sampling interval common to all the contours is determined by evaluating all the contours in the image as being integrated.

図21に、この方法の処理手順のフローチャートを示す。図示のように、画像中から1つの輪郭をターゲット輪郭として選択し(ST601)、最長輪郭長Lmaxの初期化及び代表値Rの初期化(ST602)の後に、輪郭番号sを初期化し(ST603)、輪郭上の開始地点を初期化する(ST604)。   FIG. 21 shows a flowchart of the processing procedure of this method. As shown in the figure, one contour is selected as a target contour from the image (ST601), and after initializing the longest contour length Lmax and initializing the representative value R (ST602), the contour number s is initialized (ST603). The start point on the contour is initialized (ST604).

ターゲット点における輪郭上の微分値の計算(ST605)を、輪郭を一周するまでターゲット点を移動しながら繰り返し(ST606:No→ST607)、輪郭を一周したら(ST606:Yes)、全ての輪郭を処理するまで(ST608:No)、ターゲットを次の輪郭に移し(ST609)、輪郭毎に輪郭を一周するまで、輪郭上の微分値の計算を行う(ST604〜S607)。   The calculation of the differential value on the contour at the target point (ST605) is repeated while moving the target point until it goes around the contour (ST606: No → ST607), and once the contour goes around (ST606: Yes), all the contours are processed. Until it is done (ST608: No), the target is moved to the next contour (ST609), and the differential value on the contour is calculated until it goes around the contour for each contour (ST604 to S607).

全ての輪郭の処理が終了したら(ST608:Yes)、ターゲットとした全ての輪郭の微分値の平均値avg_dを算出し(ST610)、さらにターゲットとした全ての輪郭の微分値の標準偏差値std_dを算出する(ST611)。そして、平均値avg_d及び標準偏差値std_d、並びに表4を基に、全ての輪郭に共通する等間隔サンプリングの間隔を決定する。   When processing of all contours is completed (ST608: Yes), an average value avg_d of differential values of all target contours is calculated (ST610), and a standard deviation value std_d of differential values of all target contours is further calculated. Calculate (ST611). Then, based on the average value avg_d and the standard deviation value std_d and Table 4, the interval of equal interval sampling common to all contours is determined.

本発明の第2の実施形態における第1の方法及び第2の方法によれば、1枚の画像中の複数の輪郭の中から代表となる輪郭を定め、その輪郭の複雑さに基づいて、画像中の全ての輪郭の制御点を定めるので、輪郭毎に制御点を定める処理と比べると、処理時間が短縮される。また、第3の方法によれば、1枚の画像中の複数の輪郭を一体とみなして、複数の輪郭全体の複雑さに基づいて、画像中の全ての輪郭に共通する制御点を定めるので、輪郭毎に制御点を定める処理と比べると、処理時間が短縮される。   According to the first method and the second method of the second embodiment of the present invention, a representative contour is defined from a plurality of contours in one image, and based on the complexity of the contour, Since the control points for all the contours in the image are determined, the processing time is shortened compared to the processing for determining the control points for each contour. Further, according to the third method, a plurality of contours in one image are regarded as a single body, and control points common to all the contours in the image are determined based on the complexity of the entire plurality of contours. Compared with the process of determining control points for each contour, the processing time is shortened.

なお、以上の各実施形態では、画像処理装置1が画像入力から制御点生成までの全ての画像処理を行うものとしたが、この画像処理の一部をインターネットなどのネットワーク上の画像処理サーバが実行するような画像処理システムを構成することもできる。   In each of the above embodiments, the image processing apparatus 1 performs all image processing from image input to control point generation. However, part of this image processing is performed by an image processing server on a network such as the Internet. It is also possible to configure an image processing system to be executed.

1…画像処理装置、21…画像処理部、23…ROI候補領域抽出部、24…制御点生成部、34,231…領域分割部、36,232…領域統合部、37,241…輪郭抽出部、38,242…サンプリング部。   DESCRIPTION OF SYMBOLS 1 ... Image processing apparatus, 21 ... Image processing part, 23 ... ROI candidate area extraction part, 24 ... Control point production | generation part, 34,231 ... Area division part, 36,232 ... Area integration part, 37,241 ... Contour extraction part 38, 242, sampling unit.

特開2002−49922号公報JP 2002-49922 A 特許第3070541号公報Japanese Patent No. 3070541

Claims (9)

動的輪郭モデルにより画像の輪郭抽出を行う画像処理装置であって、
画像の予め定められた特徴を基に注目領域を抽出する注目領域抽出手段と、
前記抽出された注目領域の輪郭を抽出する輪郭抽出手段と、
前記抽出された輪郭の形状を評価する輪郭形状評価手段と、
前記評価の結果に基づいて、前記抽出された輪郭をサンプリングする制御点を設定する制御点設定手段とを有する画像処理装置。
An image processing apparatus that performs image contour extraction using a dynamic contour model,
Attention area extraction means for extracting the attention area based on predetermined features of the image;
Contour extracting means for extracting the contour of the extracted region of interest;
Contour shape evaluation means for evaluating the shape of the extracted contour;
An image processing apparatus comprising: control point setting means for setting a control point for sampling the extracted contour based on the result of the evaluation.
請求項1に記載された画像処理装置において、
前記抽出された輪郭を分割して部分輪郭を生成する輪郭分割手段を有し、前記輪郭形状評価手段は、前記部分輪郭の形状を評価し、前記制御点設定手段は、前記部分輪郭毎に前記制御点を設定する画像処理装置。
The image processing apparatus according to claim 1,
A contour dividing unit that divides the extracted contour to generate a partial contour; the contour shape evaluating unit evaluates a shape of the partial contour; and the control point setting unit An image processing apparatus for setting control points.
請求項1に記載された画像処理装置において、
前記制御点設定手段は、前記評価の結果に基づいて、前記制御点を等間隔に設定する範囲と不等間隔に設定する範囲とを決定する画像処理装置。
The image processing apparatus according to claim 1,
The control point setting unit is an image processing apparatus that determines a range in which the control points are set at equal intervals and a range in which the control points are set at unequal intervals based on the result of the evaluation.
請求項1に記載された画像処理装置において、
前記抽出された輪郭から所定の一つの輪郭を選択する輪郭選択手段を有し、前記輪郭形状評価手段は、前記選択された輪郭の形状を評価し、前記制御点設定手段は、前記選択された輪郭の形状の評価の結果に基づいて、前記抽出された全ての輪郭の制御点を設定する画像処理装置。
The image processing apparatus according to claim 1,
Contour selection means for selecting a predetermined one contour from the extracted contour, the contour shape evaluation means evaluates the shape of the selected contour, and the control point setting means is the selected point An image processing apparatus that sets control points for all of the extracted contours based on a result of contour shape evaluation.
請求項4に記載された画像処理装置において、
前記所定の一つの輪郭は、中心が画像の中心に最も近い輪郭である画像処理装置。
The image processing apparatus according to claim 4,
The predetermined one contour is an image processing apparatus whose center is a contour closest to the center of the image.
請求項4に記載された画像処理装置において、
前記所定の一つの輪郭は、長さが最長の輪郭である画像処理装置。
The image processing apparatus according to claim 4,
The predetermined one contour is an image processing device having a longest contour.
動的輪郭モデルにより画像の輪郭抽出を行う画像処理方法であって、
画像の予め定められた特徴を基に注目領域を抽出する注目領域抽出工程と、
前記抽出された注目領域の輪郭を抽出する輪郭抽出工程と、
前記抽出された輪郭の形状を評価する輪郭形状評価工程と、
前記評価の結果に基づいて、前記抽出された輪郭をサンプリングする制御点を設定する制御点設定工程とを有する画像処理方法。
An image processing method for extracting an outline of an image using a dynamic outline model,
A region of interest extraction step of extracting a region of interest based on predetermined features of the image;
A contour extracting step for extracting the contour of the extracted region of interest;
A contour shape evaluation step for evaluating the shape of the extracted contour;
A control point setting step of setting a control point for sampling the extracted contour based on the result of the evaluation.
コンピュータを、請求項1乃至6のいずれかに記載された画像処理装置の各手段として機能させるための画像処理プログラム。   An image processing program for causing a computer to function as each unit of the image processing apparatus according to any one of claims 1 to 6. 動的輪郭モデルにより画像の輪郭抽出を行う画像処理システムであって、
画像の予め定められた特徴を基に注目領域を抽出する注目領域抽出手段と、
前記抽出された注目領域の輪郭を抽出する輪郭抽出手段と、
前記抽出された輪郭の形状を評価する輪郭形状評価手段と、
前記評価の結果に基づいて、前記抽出された輪郭をサンプリングする制御点を設定する制御点設定手段とを有する画像処理システム。
An image processing system that performs contour extraction of an image using a dynamic contour model,
Attention area extraction means for extracting the attention area based on predetermined features of the image;
Contour extracting means for extracting the contour of the extracted region of interest;
Contour shape evaluation means for evaluating the shape of the extracted contour;
An image processing system comprising control point setting means for setting a control point for sampling the extracted contour based on the result of the evaluation.
JP2011059829A 2011-03-17 2011-03-17 Image processing device, image processing method, image processing system, and image processing program Withdrawn JP2012194919A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011059829A JP2012194919A (en) 2011-03-17 2011-03-17 Image processing device, image processing method, image processing system, and image processing program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011059829A JP2012194919A (en) 2011-03-17 2011-03-17 Image processing device, image processing method, image processing system, and image processing program

Publications (1)

Publication Number Publication Date
JP2012194919A true JP2012194919A (en) 2012-10-11

Family

ID=47086714

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011059829A Withdrawn JP2012194919A (en) 2011-03-17 2011-03-17 Image processing device, image processing method, image processing system, and image processing program

Country Status (1)

Country Link
JP (1) JP2012194919A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016133953A (en) * 2015-01-19 2016-07-25 株式会社メガチップス Determination device, control program and determination method
US10282837B2 (en) 2015-08-31 2019-05-07 Mitutoyo Corporation Image measuring apparatus and non-temporary recording medium on which control program of same apparatus is recorded

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016133953A (en) * 2015-01-19 2016-07-25 株式会社メガチップス Determination device, control program and determination method
US10282837B2 (en) 2015-08-31 2019-05-07 Mitutoyo Corporation Image measuring apparatus and non-temporary recording medium on which control program of same apparatus is recorded

Similar Documents

Publication Publication Date Title
US20210241027A1 (en) Image segmentation method and apparatus, diagnosis system, storage medium, and computer device
CN111950453B (en) Random shape text recognition method based on selective attention mechanism
CN108921225B (en) Image processing method and device, computer equipment and storage medium
US8406527B2 (en) Pattern model positioning method in image processing, image processing apparatus, image processing program, and computer readable recording medium
US10127679B2 (en) Image alignment method and apparatus
US7536064B2 (en) Image comparison by metric embeddings
US20160086048A1 (en) Device and Method for Analyzing the Correlation Between an Image and Another Image or Between an Image and a Video
CN110555795A (en) High resolution style migration
JP2010079545A (en) Image processing apparatus, image processing method and program
Dong et al. Boosting optical character recognition: A super-resolution approach
KR102200178B1 (en) Method and device for object recognition using deep learning
CN110852349A (en) Image processing method, detection method, related equipment and storage medium
CN113826143A (en) Feature point detection
CN113221925B (en) Target detection method and device based on multi-scale image
CN112991180B (en) Image stitching method, device, equipment and storage medium
Sun et al. Multiscale generative adversarial network for real‐world super‐resolution
CN106257497B (en) Matching method and device for image homonymy points
US9087272B2 (en) Optical match character classification
JP2009169925A (en) Image retrieval device and image retrieval method
US20220188975A1 (en) Image conversion device, image conversion model learning device, method, and program
Li et al. Instance aware document image segmentation using label pyramid networks and deep watershed transformation
US11069034B2 (en) Method and system to enhance quality of digital images
JP2012194919A (en) Image processing device, image processing method, image processing system, and image processing program
Ma et al. STSRNet: Self-texture transfer super-resolution and refocusing network
Miao et al. Road centreline extraction from classified images by using the geodesic method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20140603