JP4150554B2 - Object image extraction method, object image extraction program - Google Patents

Object image extraction method, object image extraction program Download PDF

Info

Publication number
JP4150554B2
JP4150554B2 JP2002250058A JP2002250058A JP4150554B2 JP 4150554 B2 JP4150554 B2 JP 4150554B2 JP 2002250058 A JP2002250058 A JP 2002250058A JP 2002250058 A JP2002250058 A JP 2002250058A JP 4150554 B2 JP4150554 B2 JP 4150554B2
Authority
JP
Japan
Prior art keywords
block
data
region
search reference
shape
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2002250058A
Other languages
Japanese (ja)
Other versions
JP2004086793A (en
Inventor
孝 井田
修 堀
信幸 松本
秀則 竹島
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002250058A priority Critical patent/JP4150554B2/en
Publication of JP2004086793A publication Critical patent/JP2004086793A/en
Application granted granted Critical
Publication of JP4150554B2 publication Critical patent/JP4150554B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、画像中の物体領域を求める物体画像抽出方法及び物体画像抽出プログラムに関する。
【0002】
【従来の技術】
画像中から任意の物体の領域を抽出する技術は、例えば、背景を別の画像に置き換えるといった画像の加工を行う際に有用である。そのためには物体の領域をその輪郭に沿って正しく求める必要がある。
【0003】
物体の領域は具体的にはアルファマスク(あるいはシェイプデータ)と呼ばれる画像で表される。アルファマスクは物体が存在する領域(物体領域)とそれ以外の領域とで異なる画素値が設定された画像である。原画とそのアルファマスクの一例をそれぞれ、図3と図4に示す。図3の原画に写った右側の船031のアルファマスクが図4である。
【0004】
言い換えれば、物体を抽出することはアルファマスクを生成することである。アルファマスクが一度求まれば、それを参照することで簡単に物体領域以外の背景領域を別の画像に置き換えることができる。
【0005】
このような物体抽出の際、何らかの方法で暫定的に物体の概略形状が予め求まっている場合に、その概略形状を元に物体の正確な形状を求める技術が求められている。その手法の一つとして、自己相似写像を用いる物体抽出方法(フラクタル法)を提案されている(例えば、特許文献1、特許文献2、非特許文献1を参照)。この技術の概要を図5、図6、図7、図8を用いて説明する。
【0006】
図5は船031に概略形状051が与えられた様子であり、そのアルファマスクが図6である。この段階では、アルファマスクの輪郭は物体の輪郭とずれている。フラクタル法では、このような原画像データとアルファマスクの入力に対し、まず、アルファマスクを用いて物体の概略形状に沿って複数の正方形のブロックを設定する。これらのブロックをチャイルドブロックと呼ぶ。そして、原画像データの同じ位置にアルファマスクと同様にチャイルドブロックを設定する。図7は原画像データにチャイルドブロックを設定した様子である。分かりやすくするために原画像データに概略形状も示してある。
【0007】
次に、原画像データを用いて各チャイルドブロックに対応するペアレントブロックを求める。ペアレントブロックのサイズは、チャイルドブロックの縦横2倍とし、ペアレントブロックの中の画像パターン(図柄)は、チャイルドブロックの中の画像パターンと同じになるようにする。
【0008】
このようなチャイルドブロックの図柄と相似なペアレントブロックを見つけるためには、原画像データ上でチャイルドブロックの近くで縦横2倍のブロックを候補ブロックとして仮に設定する。そして、その候補ブロックを縦横1/2に縮小した縮小ブロックとチャイルドブロックの誤差を求める。
【0009】
誤差は濃淡画像の場合、例えば、絶対値誤差(各画素の差の絶対値をブロック内の全画素で加算)を用いる。このような誤差評価をいくつかの候補ブロックに対して行い、チャイルドブロックと最も誤差が小さかった候補ブロックをペアレントブロックと決定する。このようなペアレントブロックを図7に示した全てのチャイルドブロックに対して求める。
【0010】
図8は、船031の先端部分に設定されたチャイルドブロック081に対して求まったペアレントブロック082の例である。それぞれのブロックの中の図柄が相似であることが分かる。図8では、2値画像を示しているが、画素に256レベルの画素値が与えられる濃淡画像でも同様である。
【0011】
以上の処理で、チャイルドブロックとこれと相似な図柄を持つペアレントブロックの組のデータが得られるので、次に、求めたペアレントブロックをアルファマスクの同じ位置に原画像データと同様にペアレントブロックを設定する。
【0012】
物体の抽出は、チャイルドブロックとペアレントブロックを利用してアルファマスクを補正することで行う。具体的には、各チャイルドブロックのアルファマスクのデータを、それぞれに対応するペアレントブロックのアルファマスクのデータを縦横1/2に縮小したもので置き換える処理を行えば良い。
【0013】
この置き換え変換(自己相似写像)を1回行うと、概略形状は正しい形状に少し近づく。この近づいたアルファマスクに同じ置き換え変換を再度施す。このようにアルファマスクに再帰的に置き換え変換を繰り返すとほぼ正しい形状に収束する。置き換え変換を一定の回数行ったアルファマスクを物体抽出結果とする。
【0014】
【特許文献1】
特開2000−82145号公報
【0015】
【特許文献2】
特開2001−188910号公報
【0016】
【非特許文献1】
井田、三本杉,「自己相似写像による輪郭線のフィッティング」,第5回 画像センシングシンポジウム講演論文集,C−15,pp.115−120,June 1999.
【0017】
【発明が解決しようとする課題】
しかし、従来のフラクタル法では、他の物体が近くにある場合に他の物体の輪郭を抽出してしまうことがある。また、物体形状が細い場合には、物体形状が消滅してしまうことがあるなど、必ずしも正確に物体の形状を抽出できないことがある。
【0018】
そこで、本発明では他の物体が近くにある場合や、物体形状が細い場合でも正確に物体の形状を抽出することができる方法およびプログラムを提供することを目的とする。
【0019】
【課題を解決するための手段】
上記課題を解決するため、本発明の物体画像抽出方法は、抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、前記探索基準ブロック毎に、前記探索基準ブロックより大きいブロックであって前記画像データ上におけるこのブロックに対応する領域の図柄が前記画像データ上における前記探索基準ブロックに対応する領域の図柄と最も相似している相似ブロックを探索する第3のステップと、前記各探索基準ブロックに対応する領域のシェイプデータをそれぞれの相似ブロックに対応する領域のシェイプデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップとを有し、前記第1のステップでは、前記画像データ中の各画素における前記対象物体の存在する確かさを表すラベルデータも受け、前記第3のステップでは、前記ラベルデータを参照して、対象物体が存在する可能性が低い画素同士の誤差を無視若しくは軽視してブロック全体の誤差の加重和を計算し、前記加重和が最小となる相似ブロックの探索を行うことを特徴とする。
【0020】
また、前記シェイプデータが、対象物体の概略形状の領域を表し、その各画素が前記画像データの各画素と1対1に対応させたものであり、前記ラベルデータが、前記画像データを対象物体確定領域、非対象物体確定領域、未定領域の3種類のうち少なくとも2種類の領域に区分し、その各画素が前記画像データの各画素と1対1に対応させたものであるとし、前記第3のステップでは、前記相似ブロックの候補である複数の候補ブロックそれぞれについて、前記画像データにおける前記探索基準ブロックに対応する領域のデータと、前記画像データにおける候補ブロックに対応する領域を縮小したデータとの各対応点の誤差を計算し、その加重和を、前記対応点が両方共に前記ラベルデータによって対象物体確定領域に区分される領域に存在する場合、若しくは両方共に非対象物体確定領域に区分される領域に存在する場合には、当該対応点についての誤差を無視若しくは軽視して求め、前記誤差の加重和が最小となる候補ブロックを前記相似ブロックとして決定することを特徴としても良い。
【0021】
また、前記第3のステップでは、前記相似ブロックの候補である複数の候補ブロックそれぞれについて、前記画像データにおける前記探索基準ブロックに対応する領域のデータと、前記画像データにおける候補ブロックに対応する領域を縮小したデータとの各対応点の誤差を計算し、その加重和を、前記対応点が両方共に前記ラベルデータによって対象物体確定領域に区分される領域に存在する場合、若しくは、両方共に非対象物体確定領域に区分される領域に存在する場合には、当該対応点についての誤差に乗じる重み係数を0または小さな値にして求め、前記誤差の加重和が最小となる候補ブロックを前記相似ブロックとして決定することを特徴としても良い。
【0022】
本発明の物体画像抽出方法は、抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定し、これらのうち、前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが、前記対象物体の細い部分のパターンであるものは設定を解除する第2のステップと、前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、前記シェイプデータにおいて前記各探索基準ブロックに対応する領域のデータをそれぞれの相似ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップとを有し、前記第2のステップでは、前記シェイプデータ上における探索基準ブロックに対応する領域の周を走査して画素値の変化の回数を求め、変化の回数が2回を超える場合には前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが前記対象物体の細い部分のパターンであると判定する、ことを特徴とする。
【0024】
本発明の物体画像抽出方法は、抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索するとともに、前記シェイプデータ上の対応する領域のパターンが、前記対象物体の細い部分のパターンである相似ブロックとこれに対応する探索基準ブロックの設定を解除する第3のステップと、前記シェイプデータにおいて前記各探索基準ブロックに対応する領域のデータをそれぞれの相似ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップとを有し、前記第3のステップでは、前記相似ブロックに対応する前記シェイプデータ上の領域の周をそれぞれ走査して画素値の変化の回数を求め、変化の回数が2回を超える場合には前記相似ブロックに対応する前記シェイプデータ上の領域のパターンが前記対象物体の細い部分のパターンであると判定する、ことを特徴とする。
【0026】
本発明の物体画像抽出方法は、抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、前記探索基準ブロック毎に、前記探索基準ブロックより小さくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、前記シェイプデータにおいて前記各相似ブロックに対応する領域のデータをそれぞれの探索基準ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップとを有することを特徴とする。
【0027】
本発明の物体画像抽出方法は、抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受け、これらを拡大して拡大画像データと拡大シェイプデータとを生成する第1のステップと、前記拡大シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記拡大画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、前記拡大シェイプデータにおいて前記各相似ブロックに対応する領域のデータをそれぞれの探索基準ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、第4のステップで得られた拡大シェイプデータを元の大きさに縮小する第5のステップとを有することを特徴とする。
【0036】
【発明の実施の形態】
以下、図面を参照して本発明の複数の実施形態についてそれぞれ説明する。
【0037】
(各実施形態に共通な事項)図40は本発明の各実施形態で用いるPC(パーソナルコンピュータ)やWS(ワークステーション)等の図である。各実施形態で用いるPCやWSは、マウス等のポインティングデバイスやキーボードやその他の外部機器(例えばデジタルカメラ)等の入力装置4007と、入力装置4007からの入力を受け付ける入力受付部4004、CRTやLCD等の画像表示装置4008とこれに画像信号を出力する画像出力部4006を備える。
【0038】
また、各実施形態で用いるPCやWSは、ハードディスク等の磁気ディスクドライブ4002、メモリ4005、中央演算装置4001、光ディスクドライブ4003を備える。
【0039】
本発明の各実施形態はいずれも、PC(パーソナルコンピュータ)あるいはWS(ワークステーション)上で動作させる物体画像抽出プログラムである。利用者は予め磁気ディスクドライブ4002に格納しておいたプログラムをメモリ4005に読み出してPCやWSに実行させる。
【0040】
利用者は物体画像抽出プログラムを実行する前に、予め物体形状の抽出処理対象の画像データを取得して磁気ディスクドライブ4002に格納しておく。物体画像抽出プログラムは、実行時に、この画像データを磁気ディスクドライブ4002から読み出してメモリ4005に記憶させる。
【0041】
そして、表示装置4008に画像データを表示し、物体の概略形状を指定した概略形状のアルファマスクのデータを利用者にマウスを用いて入力してもらう。入力されたアルファマスクのデータもメモリ4005に記憶させておく。
【0042】
さらに、物体画像抽出プログラムは、画像データと概略形状のアルファマスクのデータをもとにして物体形状の抽出を行う。物体形状の抽出によって正確な形状のアルファマスクが生成され、これを抽出結果として出力する。
【0043】
輪郭抽出結果のアルファマスクは、PCやWSが備える磁気ディスクドライブ4002やメモリ4005に記憶させておく。そして、例えば画像中から物体の画像を切り出す他のプログラムや装置で用いる。
【0044】
尚、PCやWSにカメラを接続して利用者が任意のタイミングで画像を取得できるようにしておいても良い。また、概略形状のアルファマスクのデータを背景差分法等を用いて自動的に生成するようにしても構わない。
【0045】
尚、以下の説明では探索基準ブロックをチャイルドブロックと呼び、探索基準ブロックより大きく(例えば縦横2倍)て、かつ、図柄が相似なブロックである相似ブロックをペアレントブロックと呼ぶ。
【0046】
(第1の実施形態)本実施形態は、輪郭抽出対象物体の近くに他の物体輪郭などのエッジがある場合に、物体形状の抽出が正確に行えないことがあるのを改善するものである。
【0047】
以下、図1のフローチャートを用いて本実施形態の処理を説明する。
【0048】
(ステップ010)画像データと、概略形状のアルファマスクと、ラベルデータをメモリ上に準備する。
【0049】
画像データは、例えば利用者が予めデジタルカメラ等で撮影してハードディスクに記憶させておいた画像データを読み出す。
【0050】
アルファマスクは、例えば利用者が画像表示装置に表示された画像データを見ながらマウスで指定して作成する物体の形状を表すデータである。アルファマスクは画像データと同じ画素数のデータで、物体が存在する場所は画素値1、存在しない場所は画素値0となっている。
【0051】
ラベルデータはアルファマスクとは別の物体領域や背景領域に関する情報を表すデータであり、利用者が画像データを見ながらマウスを利用して指定して作成するものである。画素毎に、例えば、予め必ず背景や対象物以外の物体だと分かっている領域は非対象物体確定領域(背景確定領域)として各画素の画素値を0とし、予め物体だと分かっている領域は対象物体確定領域(物体確定領域)として各画素の画素値を1とし、背景か物体か未定の領域は未定領域として各画素の画素値を2とする。尚、ラベルデータの生成は、例えばアルファマスクを参照して、自動的に行っても良い。
【0052】
(ステップ011)アルファマスクの輪郭部分にチャイルドブロックCを設定する。本実施形態ではチャイルドブロックCは図7のように互いに重なり合うように設定するが、重ねずに接するように設定しても良い。設定したチャイルドブロックCの位置情報(例えば、左上角の座標と右下角の座標)をメモリに記憶しておく。
【0053】
(ステップ012)各々のチャイルドブロックと相似なブロックであるペアレントブロックPをラベルデータと画像データを参照しながら見つける。
【0054】
まず、チャイルドブロックの近傍にペアレントブロック候補となる候補ブロックを設定する。そして、画像データ上で、チャイルドブロックの領域のパターンと候補ブロックとの領域のパターンとのラベルデータを参照して誤差を求める。複数の候補ブロックについて誤差を計算し、誤差が最小となるものをペアレントブロックとする。候補ブロックはペアレントブロックと同じ画素数のブロックであるので、チャイルドブロックと候補ブロックとの誤差を求める際には、候補ブロックを縮小してチャイルドブロックと同じ画素数にして行う。
【0055】
ラベルデータを参照した誤差計算は次のようにして行う。例えば、利用者が図15の領域151の内側の物体を抽出しない領域として指定した場合、ラベルデータは、この内部が0の画素値(背景確定領域)、それ以外が2の画素値(未定領域)とする。そして、チャイルドブロックのある画素をXc、それに対応する縮小ブロックの画素をXpと表すとして、XcとXpの誤差を以下のように定義する。(1)XcとXpの両方が背景確定領域内の時は「XcとXpの誤差」を無視して「0」とする。
(2)XcとXpの両方が物体確定領域内の時も「XcとXpの誤差」を無視して「0」とする。
(3)前記(1)でも(2)でもないときは、「XcとXpの誤差」=「XcとXpの画素値の差の絶対値」とする。
【0056】
このようにして求めたXcとXpの誤差をブロック内で加算し、その候補ブロックとチャイルドブロックの誤差とする。そして、最も小さい誤差が得られた候補ブロックをペアレントブロックとして決定する。そして、決定したペアレントブロックの位置情報をチャイルドブロックと対応付けてメモリに記憶しておく。
【0057】
(ステップ013)全てのチャイルドブロックに対するペアレントブロックが決定するまで、前記ステップ012を繰り返す。
(ステップ014)アルファマスク上において、各々のチャイルドブロックに対応する領域のデータを、それに対応するペアレントブロックのデータをチャイルドブロックと同じ画素数に縮小したもので置き換える。
(ステップ015)全てのチャイルドブロックに対して、前記ステップ014を行う。これにより、アルファマスクの全てのチャイルドブロックが一度置き換えられたことになる。
(ステップ016)ステップ014とステップ015を再帰的に所定の回数繰り返す。これにより、アルファマスクの輪郭が物体の輪郭に漸近する。
【0058】
尚、ステップ12で誤差計算にあたっては、(1)と(2)のケースでは誤差を無視して0としたが、誤差を軽視、すなわち、0より大きくて1より小さい所定の係数を乗じても良い。あるいは、(1)と(2)のケースでは、誤差を無視して計算そのもの省略しても良い。
【0059】
以下、従来のフラクタル法による物体形状の抽出例と本実施形態の物体形状の抽出例を比較を行う。
【0060】
他の物体が近くにある場合に、従来のフラクタル法を用いて物体形状の抽出を行った例を説明する。図9に示したチャイルドブロック091には、右下の船031の領域に加えて左上の船032の領域も含まれている。この場合、チャイルドブロック091と完全に相似な、つまり絶対値誤差が0となる候補ブロックは見つからない可能性が高いが、誤差が最小となる候補ブロックがペアレントブロックとして選ばれることになる。
【0061】
船031を抽出するためには、ペアレントブロックには船031の領域に関して相似になるようなブロック093が選ばれるのが都合がよい。このようになれば、アルファマスクの輪郭は置き換え変換によって船031の輪郭に収束するからである。しかし、必ずしもブロック093が選ばれるとは限らない。
【0062】
図11(a)はチャイルドブロック091の周囲を拡大した図であり、ペアレントブロック候補のブロック093、船032の輪郭114、船031の輪郭115が示されている。尚、図11(a)では、ペアレントブロック候補のブロック093は、船031の輪郭115に関して相似になるように設定されている。
【0063】
図11(b)には、チャイルドブロック091の画像パターン111、ブロック093を縮小した画像パターン112、および画像パターン111と画像パターン112の差分パターン113が示されている。
【0064】
ここで、横線で塗った船032の領域及び船031の領域の画素値は同じ値とし、それら以外の領域は別の画素値で一定とする。差分パターン113では、画像パターン111と画像パターン112で画素値の誤差が生じる部分を黒く塗ってある。絶対値誤差はこの黒い領域の面積に比例する。
【0065】
一方、図12(a)及び図12(b)は、ペアレントブロック候補であるブロック121が輪郭114に関して相似になるように設定した場合である。この場合の差分パターン122の黒領域の面積は図11(b)の差分パターン113よりも小さくなってしまう。この結果、図10のようにブロック121がペアレントブロックとして選ばれ、船031のアルファマスクの輪郭はこの部分については置き換え変換によって船032に近づいてしまうため、正しい輪郭が求まらない。
【0066】
これに対し、ステップ012のようにラベルデータを用いて処理することにより、物体抽出に都合のよいペアレントブロックが選択される。このことを図3の原画像から図4のようなアルファマスクを生成する場合を例に説明する。
【0067】
図5は物体の概略形状が与えられた状態であり、この概略形状のアルファマスクが図6である。そして、チャイルドブロックが配置された結果が図7である。
【0068】
図13(a)はチャイルドブロック091の周辺を拡大した図である。輪郭114は船032の輪郭であり、輪郭115は船031の輪郭である。また、ペアレントブロック093は船031輪郭115に関して相似になるように配置されている。背景確定領域の境界線である背景確定領域ライン131の左上側が前述の図15で示した背景確定領域151である。
【0069】
図13(b)はチャイルドブロック091の画像パターン132と、ペアレントブロック093の画像パターン133(チャイルドブロックと同じ大きさに縮小したもの)と、画像パターン132と画像パターン133の差分パターン134とを示した図である。
【0070】
尚、図13(b)では、画像パターン132及び画像パターン133には背景確定領域ライン131も示し、差分パターン134には、画像パターン132における背景確定領域と画像パターン133における背景確定領域の共通領域の境界ライン135も示した。
【0071】
図11(a)及び図11(b)で説明したように、従来、このようなペアレントブロックの配置では、左上側に多くの誤差が発生していた。しかし、本実施形態では、画像パターン132と画像パターン133においてどちらも背景確定領域である画素の誤差はゼロとしているため、差分パターン134の境界ライン135よりも左上側の領域には誤差が現れない。そのため、従来に比べて差分パターン134のようにブロック全体での誤差が小さくなる。
【0072】
図14(a)及び図14(b)は、ペアレントブロックを図12(a)及び図12(b)と同様に、船032の輪郭114に関して相似になるように配置した場合の図である。この場合も図13のケースと同様にライン135の左上側の誤差がキャンセルされるが、元々ライン135の左上側には誤差がないので、全体としては図12のケースと同様に右下側の誤差が生じる。
【0073】
図13と図14とを比較すると、本実施形態では図13のケースの方が図14のケースよりも誤差が小さくなり、図13のケース、すなわち、輪郭115に関して自己相似になるようにペアレントブロックが選ばれるので、船031の輪郭が正しく抽出される。
【0074】
本実施形態では、ラベルデータは利用者がマウスを利用して予め指定しておくとしたが、以下に説明するラベルデータを自動的に求める方法を利用してラベルデータを求めても良い。
【0075】
また本実施形態では、ステップ014とステップ015を所定の回数繰り返すとしたが、繰り返しの条件は「回数」に限られない。例えば、ステップ015で置き換えを行う際にチャイルドブロックのアルファマスクとペアレントブロックのアルファマスクを縮小したものとの絶対値差分の和を計算し、絶対値差分の和が所定の閾値以下になるまで繰り返すようにしても良い。
【0076】
(第1のラベルデータ生成方法)例えば、予め、物体の色や背景の色が分かっている場合には、その色の領域をそれぞれ物体確定領域、背景確定領域とする方法もある。
【0077】
この方法について、上述のように概略形状051が与えられた場合を例に説明する。
【0078】
(1)図37に示すように概略形状051を一定の幅Wで膨張させて形状371を求める。同様にして2Wの幅で膨張させて形状372を求める。
【0079】
ここで、膨張とはモルフォロジーフィルタによる処理の一種であり、処理対象領域(ここでは物体領域)以外の画素を走査しながら、注目画素から一定の距離以内に処理対象領域がある場合にはその画素を処理対象領域に加える処理である。
【0080】
(2)概略形状051をWと2Wの幅で収縮させてそれぞれ形状373と形状374を求める。
【0081】
ここで、収縮もモルフォロジーフィルタによる処理の一種であり、処理対象領域の画素を走査しながら、注目画素から一定の距離以内に処理対象領域以外がある場合にはその画素を処理対象領域から除く処理である。
【0082】
(3)形状371と形状372に挟まれた領域381(図38の斜線で示した領域)を背景色サンプリング領域とする。また、形状373と形状374にはさまれた領域382(図38の横線で示した領域)を前景色サンプリング領域とする。ここで、概略形状051から一定距離離れた部分から色をサンプリングするのは、概略形状が正しい形状とずれていることを考慮しているためである。
【0083】
(4)元画像において背景色サンプリング領域にある画素の色をすべて取り出すことで背景色テーブルを作成する。また、同様にして前景色テーブルを作成する。
【0084】
尚、全ての色を取り出すのではなく、一定数以上の画素が同じ色であった場合にその色を登録しても良い。
【0085】
(5)背景色テーブルと前景色テーブルとを比較して、同じ色が登録されていたら、その色を両テーブルから除く。
【0086】
(6)このようにして得られた2つの色テーブルを用いて元画像の各画素を走査する。そして、背景色テーブルにある色の画素を背景確定領域とし、前景色テーブルにある色の画素は物体確定領域とし、いずれのテーブルにない色の画素は未定領域としてラベルデータを作成する。
【0087】
上記(1)〜(6)のようにすることで色の観点で背景や物体と推定できる領域をそれぞれの確定領域とすることができる。
【0088】
尚、似た色を個別に登録するのではなく、予め元画像の色レベルを量子化してから色テーブルの作成、ラベルデータの作成を行うと扱う色数が減るので処理量を減らすことができ、処理の高速化に資する。
【0089】
(第2のラベルデータ生成方法)画面内で局所的に色テーブルを作成し、それぞれ切換えながらラベルデータを作成すれば、局所的に最適化された情報が得られる。
【0090】
局所的に色テーブルを作成する例としては、次のような方法が考えられる。例えば、図39に示したように、概略形状051に沿ってブロック391、392などを配置し、各ブロックの内部だけで前述した色テーブルを作成する。そして、ラベルデータを作成する際には各画素が属するブロックの色テーブルを用いて、背景確定、物体確定、未定のいずれかに決定する。その際、ブロック391と392とが重なっている部分では、まず、どちらかのブロックの色テーブルでラベルを決め、そのラベルが未定であったときには、他方の色テーブルでラベルを付け直す。
【0091】
(第3のラベルデータ生成方法)背景色テーブルや物体色テーブルの生成にあたっては、モルフォロジーフィルタを用いる代わりに、利用者が背景あるいは物体として画面を指示した画素の色を登録して生成する方法もある。
【0092】
(第3のラベルデータ生成方法)予め輪郭抽出対象の物体が写っていない背景画像が取得できている場合には、背景画像と現在の画像の差を求め、差が一定値以上の画素を物体確定とする方法もある。
【0093】
(第4のラベルデータ生成方法)概略形状の輪郭から一定の範囲内に正しい輪郭があると仮定できる場合には、概略形状の背景領域を収縮した結果を背景確定領域としたり、概略形状の物体領域を収縮した結果を物体確定領域とすることもできる。この方法ならば、処理対象領域の周囲が縮められる。
【0094】
(第5のラベルデータ生成方法)概略形状の物体領域が必ず物体の全体を含むことが分かっている場合には、概略形状の背景領域をそのまま、あるいは、1〜2画素収縮したものを背景確定領域とする。一方、概略形状の物体領域を数画素、例えば、チャイルドブロックの1辺の画素数の1/2程度収縮した領域を物体確定領域とする。
【0095】
さらに、このようにして決めた物体確定領域や背景確定領域を領域成長法を用いて、広げても良い。逆に、概略形状の物体領域の全体が必ず物体に含まれる場合も同様である。
【0096】
ここで、領域成長法とは、成長対象の領域の境界部分において領域内部と外部の画素値を比較し、画素値の差が一定値以下である場合には、外部の画素を領域内にとりこんでいくというものである。この処理を繰り返すことにより、画素値が近い部分が領域に取り込まれる。
【0097】
(第6のラベルデータ生成方法)利用者によって物体上の1点が入力されたときに、その点を起点として領域成長法により物体領域を求め、それを物体確定領域としてもよい。背景についても同様に領域成長法を用いて背景確定領域を設定できる。
【0098】
(ラベルデータの段階数)ここまでのラベルデータ生成方法では、背景確定、物体確定、未定の3段階のデータを生成する例を述べたが、段階数を増やしてもよい。例えば、背景である確率が高いほどラベルデータの画素値を0に近づけ、物体である確率が高いほど画素値を255に近づけ、未定領域は画素値128に対応させるような段階付けが考えられる。
【0099】
何らかの方法で(例えば上述第1のラベルデータ生成方法における背景色サンプリングと物体色サンプリングの方法などにより)背景と物体の色を調べておく。そして、各画素が背景と物体の色のどちらに近いかに応じてラベルデータの画素値を決めてラベルデータを生成する。
【0100】
このようにして生成したラベルデータを用いたペアレントブロック探索は、チャイルドブロックのある画素の画素値をXc、ペアレントブロック候補の縮小ブロックの画素の画素値をXp、「XcとXpの画素値の差の絶対値」をE、誤差計算用の重み係数をWとして、
「XcとXpの誤差」=W×E
を各画素毎に計算して和を求め、「XcとXpの誤差」が最小となるものをペアレントブロックとして採用する。
【0101】
ここで重み係数Wは、
(A)XcとXpの両方のラベルデータの画素値が0にも255にも近くない場合には常に1に保つ。
(B)XcかXpのいずれか一方のラベルデータの画素値が0に近い場合には、他方のラベルが小さいほど重み係数Wを1より小さくする。
(C)XcかXpのいずれか一方のラベルデータの画素値が255に近い場合には、他方のラベルが大きいほど重み係数Wを1より小さくする。
【0102】
このようにWを制御することで、物体である確率が高い画素同士や背景である確率が高い画素同士の誤差の影響を多段階で軽減できる。
【0103】
以上、本実施形態では、物体の輪郭抽出にあたってラベルデータというマスキング情報を用いることにより、複数の物体が近接している場合でも正確に輪郭を抽出できる。
【0104】
(第2の実施形態)以下、本発明の第2の実施形態について図3と図26を用いて説明する。本実施形態は、複数の物体を個別に順次抽出するときに有効な実施形態である。尚、ここでは第1の実施形態と異なる部分を中心に説明する。
【0105】
図3に示した画像には船032と船031とが存在し、本実施形態ではこれらの輪郭を順次抽出する。ここではまず、船032は第1の実施形態で説明した方法で抽出し、それから船031を抽出する。
【0106】
図26は、第1の実施形態で説明した方法で抽出した船032の物体領域261を黒く塗りつぶした図である。この状況に対して、第1の実施形態と同様にして、図5のように概略形状を設定し、チャイルドブロックを図7のように配置する。
【0107】
そして、チャイルドブロックのある画素の画素値をXc、それに対応する縮小ブロックの画素の画素値をXpとして、XcとXpの誤差の計算式を、
(1)XcあるいはXpのいずれか一方が領域261内のときは、「XcとXpとの誤差」=「0」
(2)前記(1)に該当しない時は、「XcとXpとの誤差」=「XcとXpとの画素値の差の絶対値」
のように定義する。
【0108】
このように定義することで、図11における画像パターン112の左上の横線領域内では誤差がカウントされなくなり、ブロック093の誤差がゼロとなりこれがペアレントブロックとして選択される。すなわち、図9のチャイルドブロック091に対して船031の輪郭に関して相似なペアレントブロック093が求まるような誤差の計算式になる。
【0109】
以上、本実施形態によれば複数の物体の輪郭を順次抽出する際に、既に検出済みの物体の輪郭の情報を利用して検出済み物体をマスキングするので、複数の物体が近接している場合でも正確に物体の輪郭を抽出可能である。
【0110】
(第3の実施形態)本発明の第3の実施形態について図面を参照して説明する。本実施形態は、従来、物体領域が細い場合に輪郭の検出が困難な場合があったが、これを解決するためのものである。尚、ここでは第1の実施形態と異なる部分を中心に説明する。
【0111】
従来のフラクタル法では、図16のチャイルドブロック161周辺のような物体形状が細い場合の物体抽出を行うことが困難である。
【0112】
細い部分に配置されたチャイルドブロック161に対しては、完全に相似なペアレントブロックは存在しない。チャイルドブロック161に対しては、例えば、ブロック162がペアレントブロックとして選ばれる。
【0113】
このチャイルドブロック161とペアレントブロック162を用いて、概略形状051のアルファマスクに対してペアレントブロック162からチャイルドブロック161への置き換え変換を行うと、その度にこの部分の物体領域の幅が1/2になり、置き換え変換を繰り返し行うといずれ物体領域は消滅してしまう。
【0114】
本実施形態は上述の問題に対応することができるものである。以下、図2のフローチャートを用いて本実施形態における処理の流れを説明する。
【0115】
(ステップ020)第1の実施形態のステップ010と同じ処理を行う。
【0116】
(ステップ021)概略形状のアルファマスクの輪郭部分に沿って、図7のようにチャイルドブロックを配置する。
(ステップ022)ステップ021で配置されたチャイルドブロックのうち、物体の細い部分に配置されていると判定されたものを除去する。細い部分であるか否かの判定方法については後述する。
【0117】
(ステップ023)ステップ022でキャンセルされなかったチャイルドブロックと相似なペアレントブロックを画像データを参照しながら見つける。本実施形態では、第1の実施例のようにラベルデータも参照しながら相似ブロックを求める。
(ステップ024)全てのチャイルドブロックに対するペアレントブロックを決定するまで、前記ステップ023を繰り返す。
【0118】
(ステップ025)アルファマスク上で、各々のチャイルドブロックに対応する領域のデータを、それに対応するペアレントブロックの領域のデータをチャイルドブロックと同じ画素数に縮小したもので置き換える。
(ステップ026)全てのチャイルドブロックに対して、ステップ025を行う。これにより、アルファマスクの全てのチャイルドブロック内部が一度置き換えられたことになる。
(ステップ027)ステップ025と026を再帰的に所定の回数繰り返す。これにより、アルファマスクの輪郭が物体の輪郭に漸近する。
【0119】
尚、本実施形態ではラベルデータを用いるとしたが必須ではない。従来と同じくラベルデータを用いなくても良い。
【0120】
このように処理することにより、細い物体部分ではチャイルドブロックが配置されないため、その部分が消滅するという不具合を多くの場合に回避できる。
【0121】
上記ステップ022における、物体の細い部分であるか否かの判定は、判定対象のチャイルドブロックのアルファマスクでの画素値を用いて行う。以下、具体的な処理方法を図18、図19、図20、図21、図22を用いて説明する。
【0122】
図18は16×16画素のチャイルドブロックのアルファマスクを拡大したものである。白い画素は物体を表し、黒い画素は背景を表す。
【0123】
このチャイルドブロックのアルファマスクに対して、左上端の画素から右上端の画素まで順に1画素ずつ走査して、画素値の変化の回数を数える。さらに、右上端の画素から右下端の画素、右下端の画素から左下端の画素、左下端の画素から左上端の画素と4辺を走査し、変化の回数を全て数え上げる。
【0124】
このようにして求める変化回数は必ず偶数になる。そして、変化回数が4回以上である場合には、そこは物体の細い部分であると判定する。
【0125】
図18の場合、左上端の画素から右上端の画素までの走査と、右下端の画素から左下端の画素までの走査でそれぞれ黒から白、白から黒の2回ずつ変化し、変化回数は合計で4回となるので、細い部分であると判定される。
【0126】
チャイルドブロックは概略形状の輪郭に沿って配置されているため、このようにブロックの周囲を走査すると、細い部分でなければ通常は図21に示したような変化回数が2回のケースとなる。変化回数が2回の場合にはフラクタル法により抽出可能である。
【0127】
変化回数が2回よりも多い場合は、複雑な形状をしていたり細い部分であると推定される。複雑な形状の場合、フラクタル法では対応できないことが多い。
【0128】
図19に変化回数が6回、図20に変化回数が4回の例を示す。このようなケースでは、自己相似性がないため無理にフラクタル法を適用せずに、チャイルドブロックをキャンセルして概略形状をそのまま残すことにより、物体領域の消滅を回避した方が良いと考えられる。
【0129】
図22に示したケースでは変化回数が0回となり、この場合は置き換え変換によりこの白い物体領域は消滅する。この小さい物体がノイズなどであり、消滅して構わない場合にはチャイルドブロックはこのまま残して構わないが、これが小さな物体であることが分かっている場合には、利用者がマウスで指定する等の手法で情報を与えてこのチャイルドブロックをキャンセルする。
【0130】
上述の例では、ステップ022でチャイルドブロックの4辺を走査した。この方法は簡便でよいのだが、細い物体部分の消滅を完全には回避できない。
【0131】
例えば、チャイルドブロックのパターンは、図21(a)であっても、そのペアレントブロックが図20(a)であるような場合には、1回の置き換え変換でそのチャイルドブロックが上書きされ、置き換え変換の繰り返しによって物体領域は消滅してしまう。
【0132】
このような状況を避けるには、とりあえずペアレントブロックを求め、そのペアレントブロックの4辺を走査してアルファマスクの画素値の変化回数を数える。そして、変化回数が2より大きい場合にはそのペアレントブロックとチャイルドブロックをキャンセルする。
【0133】
この場合のフローチャートを図23に示す。チャイルドブロックとペアレントブロックを除去するステップ234以外は図2と同じなので他のステップの説明は省略する。
【0134】
図17は、チャイルドブロック161とペアレントブロック162の位置関係の一例を表す図である。これまでに、チャイルドブロック161の4辺を走査する例とペアレントブロック162を走査する例を述べた。
【0135】
この他に、チャイルドブロックと中心を共有しペアレントブロック162と同じ大きさのブロック163の4辺を走査して、同様に変化回数によって細い部分であるか否かの判定を行ってもよい。ブロック163であれば、ペアレントブロックの探索前に判定できるので処理量を削減できる。また、チャイルドブロック161を用いるよりもペアレントブロック162を用いた判定に近い結果が得られる。
【0136】
以上、本実施形態ではペアレントブロックの4辺の画素を走査して、ペアレントブロック内に含まれている物体の形状を推定した上で置き換え処理を行うか否かを決定しているので、物体の細い部分や複雑な形状の部分等の輪郭を残すことができる。
【0137】
(第4の実施形態)置き換え変換の繰り返しによって消滅する物体領域は、ペアレントブロックの幅よりも細い形状の物体領域である。従って、物体領域の消滅を回避するには、概略形状の許容誤差は小さくなるが、ペアレントブロックとチャイルドブロックを小さくすれば良いと考えられる。
【0138】
しかし、もともと、チャイルドブロックが例えば4×4画素というような小さなブロックの場合、これ以上小さくすると、解像度が粗くなり、自己相似性を利用するのに十分な画像パターンが得られなくなってしまう。
【0139】
そこで本実施形態では、ペアレントブロックのサイズを変えずに原画像と概略形状を拡大し、物体領域をペアレントブロックの幅よりも太くすることで消滅を回避する。そして、必要であれば、抽出結果のアルファマスクを元のサイズに縮小する。
【0140】
本実施形態のフローチャートを図27に示す。これまでの実施形態と異なるのは、処理の一番最初に原画像と概略形状を拡大するステップ271を行う点である。ステップ271における原画像の拡大は、例えば0次内挿、線形(1次)内挿、あるいは、もっと高次の画素内挿法を用いて行う。アルファマスクである概略形状の拡大には、例えば0次内挿を用いる。以降のステップは、これまでの実施形態と同様なので説明を省略する。
【0141】
以上、本実施形態では元画像を拡大して輪郭抽出を行うので、従来の輪郭抽出処理法では形状が消滅してしまう可能性が高い、物体の細い部分の輪郭であっても正確に抽出できるようになる。
【0142】
(第5の実施形態)本実施形態は画像の端にある物体の輪郭を抽出するのに好適な輪郭抽出処理に関する実施形態である。
【0143】
フラクタル法においては、原画像の外側に一定の幅をパディングした方が高い抽出精度が得られる場合がある。例えば、図24に示すように原画像241の中に斜線で示した部分に物体242があり、物体242の輪郭と多少ずれた概略形状243が与えられたとする。
【0144】
図24のように配置されたチャイルドブロック244の場合、概略形状243を物体242の輪郭に近づけるためには、ペアレントブロックは、その内部の画像パターンがチャイルドブロックと相似になるように、図示した位置のブロック245に配置するのが望ましい。
【0145】
ペアレントブロックの探索はチャイルドブロックを中心とした一定の範囲で行われるので、その範囲にブロック245があればよい。しかし、図24の場合はブロック245の右側が画像からはみ出してしまうため、ブロック245はたとえ探索範囲内であっても誤差評価が行われず、ペアレントブロックの候補から除かれる。そのため、チャイルドブロック244の部分ではペアレントブロックとして、図示したものとは別のブロックが選ばれ、輪郭が正確に求まらなくなってしまう。
【0146】
そこで、本実施形態では図25に横線で示した領域253のように、探索範囲となる可能性がある分だけ予め画像を外側に拡張しておく。これをパディングと呼ぶ。
【0147】
本実施形態では、パディングの画素値は画像の最も外側の画素値で外挿し、パディングを行う位置と幅は以下のように決める。
【0148】
概略形状の輪郭上にチャイルドブロックを配置することが予め分かっている場合、物体抽出に先立って、まず、概略形状243に外接する矩形251を求める。矩形251が求まれば、この内部を中心にチャイルドブロックが配置された場合に、ペアレントブロックの探索範囲となりうる部分の外枠252が決まる。
【0149】
外枠252の内部は、ペアレントブロックの探索時に候補ブロックとして誤差を計算する可能性がある。そこで、外枠252が画像241からはみでた幅だけパディングを行う。その際、画像241の左上側や右下側のように外枠252がはみだしていない部分のパディングは必要ないが、画像データを記憶させるためのメモリの容量に特に制限がない場合には、上下左右の全ての側に十分な幅のパディングを行ってもよい。このように画像の外側をパディングすることで、画像の端の近くの輪郭線を正確に抽出できない問題を回避できる。
【0150】
図28は本実施形態の物体抽出処理のフローチャートである。いわゆるフラクタル法による物体抽出の最初にステップ281を実行してパディングを行う。他のステップは、これまでの実施形態と同様である。
【0151】
以上、本実施形態では原画像の外側に所定の幅でパディングを設けることにより、画像の端に存在する輪郭の抽出を正確に行えるようになる。
【0152】
(第6の実施形態)本実施形態は概略形状と正しい形状のズレが大きい場合の輪郭抽出処理に関する実施形態である。
【0153】
図30は、従来のフラクタル法では正しく物体輪郭を抽出できないケースの一例である。図30は、物体の輪郭301とその概略形状302と、概略形状302の輪郭上に中心がくるように配置したチャイルドブロックの一つであるチャイルドブロック303を示した図である。
【0154】
チャイルドブロック303には物体輪郭301が含まれていないので、ペアレントブロックの探索ではチャイルドブロック303と相似なブロックとして、例えば、図31に示したブロック311が選ばれてしまう。このように、概略形状と正しい形状のズレが大きい場合には、物体の自己相似構造を抽出できず、その結果、物体の輪郭が正しく抽出されないことがある。
【0155】
そこで、本実施形態ではペアレントブロックを先に配置する。これを図32と図33に示す。まず、図32のブロック321のように概略形状302の輪郭上に中心がくるようにペアレントブロックを配置する。そして、このペアレントブロックと相似な縦横1/2のブロックを探索する。
【0156】
この場合、ブロック321の左下に物体輪郭301が含まれるので、このブロック321と相似な縦横1/2のブロックを探索すると図33ようにブロック331がチャイルドブロックとして選ばれる。
【0157】
図29は本実施形態の輪郭抽出処理のフローチャートである。ステップ291〜ステップ293までがペアレントブロックを先に配置して相似なチャイルドブロックを探索する処理である。これ以降の置き換え処理は、先の実施形態のものと同様である。
【0158】
(ステップ291)アルファマスクの輪郭部分にペアレントブロックPを配置する。チャイルドブロックを配置する例を示した図7と同様、ペアレントブロックPの各々の中心を概略形状の輪郭が通り、隣り合うペアレントブロックは重なり合うよう配置する。
(ステップ292)ペアレントブロックPと相似なチャイルドブロックCを見つける。
(ステップ293)全てのペアレントブロックに対して前記ステップ292を行い、それぞれチャイルドブロックを決定する。
以下は、これまでと同様な置き換え処理なので説明を省略する。
【0159】
以上本実施形態では、ペアレントブロックを先に概略形状の輪郭に配置し、後でチャイルドブロックを探索することので、チャイルドブロックを先に配置した場合よりも概略形状と正しい形状との間の許容誤差が大きくなるので、従来よりも物体の自己相似構造を抽出しやすくなる。その結果、物体が正しく抽出しやすくなる。
【0160】
(第7の実施形態)本実施形態は物体領域と背景領域の中間状態も表すアルファマスクを得るのに好適な輪郭抽出処理に関する実施形態である。以下、本実施形態について説明する。
【0161】
図36は本実施形態による輪郭抽出処理のフローチャートである。
(ステップ361)図34に示すように、画像データ342及び概略形状のアルファマスク341を所定の倍率で拡大して、拡大画像データ344及び拡大アルファマスク343を生成する。本実施形態では拡大率は縦横2倍とする。
(ステップ362)拡大画像データ344および拡大アルファマスク343に対し前述したフラクタル法の処理を行って、正確なアルファマスクを抽出する。ここで、アルファマスクの各画素の画素値は背景を0、物体を255とする。
(ステップ363)フラクタル法により得られたアルファマスクを元のサイズに縮小して、画像データ342に対するアルファマスクを得る。
【0162】
図35はステップ363の拡大アルファマスクの元サイズへの縮小処理を説明する図である。本実施形態では元サイズの画像を縦横2倍に拡大してフラクタル法の処理を行っているので、拡大アルファマスクの4つの画素353が縮小して得られるアルファマスクの画素352に対応する。本実施形態では、縮小して得られるアルファマスクの画素352の画素値には画素353の画素値の平均値を用いることとする。従って、縮小して得られるアルファマスクの各画素の画素値は4個の画素の平均値となる。
【0163】
本実施形態では、拡大アルファマスクの各画素は、背景の場合は画素値0を与え、物体の場合は画素値255を与えておく。従って、縮小して得られるアルファマスクの各画素に対応する4個の拡大アルファマスクの画素のうち、物体画素が0個、1個、2個、3個、4個の場合、平均値はそれぞれ、0、64、128、192、255となる。
【0164】
図35では、画素352には物体画素が2個含まれるので画素352の画素値は128となる。また、画素354のように対応画素の値がすべて同じであれば、それらに対応する画素351はその値と同じになる。
【0165】
このようにして得られたアルファマスクの各画素の画素値を抽出物体を別の画像に合成するときの画素混合比率として用いることにより、輪郭線が与えるギザギザ感が改善された、より自然な合成画像を得ることができる。
【0166】
合成画像の画素値の計算式は、抽出物体が写っている画像の画素の画素値をX、その画素に対応するアルファマスクの値をA、合成相手となる別の画像による同じ位置の画素の画素値をYとすると、
「合成画像の画素値」=(A×X+(255−A)×Y)/255
のようなる。このように、アルファマスクの各画素の画素値は0を完全な透明、255を完全な不透明とした透明度を表したものと見なせる。
【0167】
なお、前述した拡大処理においては、画像データに対しては、例えば1次内挿、アルファマスクに対しては例えば0次内挿によって画素内挿を行う。また、例えばサムネイル画像と呼ばれる縮小画像のためのアルファマスクを生成するような場合には、元画像を拡大する必要は無く、元のサイズで0と255の値を持つアルファマスクを生成した後に前述した要領で縮小すれば良い。
また、画像データと生成したアルファマスクとを用いて、例えば画像圧縮規格PNGやGIFなど、透明度に対応した画像を生成して保存しておけば汎用の物体画像となり、再利用が可能となる。
【0168】
以上、本実施形態では元画像を拡大して輪郭抽出を行って得られる拡大アルファマスクを縮小してアルファマスクを生成する際に、拡大アルファマスクの複数の画素値を参照して求めた多段階の値をアルファマスクの各画素値として用いている。よって、物体を抽出する際にアルファマスクの画素値を透明度として用いることで、滑らかな物体の輪郭線を得ることが可能である。
【0169】
【発明の効果】
以上、本発明によれば、フラクタル法において、他の物体輪郭などのエッジが近くにある場合や物体領域が細い場合でも、物体の輪郭を正確に求めることができる。
【図面の簡単な説明】
【図1】 本発明第1の実施形態の輪郭抽出処理のフローチャート。
【図2】 本発明第3の実施形態の輪郭抽出処理のフローチャート。
【図3】 抽出対象画像の例。
【図4】 図3の画像に関するアルファマスクの例。
【図5】 概略形状を設定した様子。
【図6】 概略形状のアルファマスク。
【図7】 チャイルドブロックを配置した様子。
【図8】 あるチャイルドブロックとそのペアレントブロックの例。
【図9】 別のチャイルドブロックとそのペアレントブロックの例。
【図10】 図9において別のペアレントブロックが選ばれた例。
【図11】 図9において誤差が計算される様子。
【図12】 図10において誤差が計算される様子。
【図13】 本発明によって誤差が計算される例。
【図14】 本発明によって誤差が計算される別の例。
【図15】 ラベルデータを入力した例。
【図16】 細い部分にチャイルドブロックが配置された例。
【図17】 細い部分に配置されたチャイルドブロックとその周囲のペアレントブロックなどの例。
【図18】 チャイルドブロックにおけるアルファマスク。
【図19】 アルファマスクのパターンの例:変化回数が6。
【図20】 アルファマスクのパターンの例:変化回数が4。
【図21】 アルファマスクのパターンの例:変化回数が2。
【図22】 アルファマスクのパターンの例:変化回数が0。
【図23】 本発明第3の実施形態の輪郭抽出処理の変形例のフローチャート。
【図24】 画像の端に物体がある例。
【図25】 画像の端にパディングを設けて拡張した例。
【図26】 一つ目の物体の領域を抽出して、マスクが設定された例。
【図27】 本発明第4の実施形態の輪郭抽出処理のフローチャート。
【図28】 本発明第5の実施形態の輪郭抽出処理のフローチャート。
【図29】 本発明第6の実施形態の輪郭抽出処理のフローチャート。
【図30】 チャイルドブロックを配置した例。
【図31】 ペアレントブロックを求めた例。
【図32】 ペアレントブロックを配置した例。
【図33】 チャイルドブロックを求めた例。
【図34】 画像データとアルファマスクを拡大する処理の概念を説明する図。
【図35】 アルファマスクの縮小処理の概念を説明する図。
【図36】 本発明第7の実施形態の輪郭抽出処理のフローチャート。
【図37】 概略形状に膨張と収縮を行った例。
【図38】 色テーブルを作成する際のサンプリング領域を示した図。
【図39】 局所的に色テーブルを作成する例。
【図40】 本発明の各実施形態で用いるコンピュータの概略構成を説明する図。
【符号の説明】
031 輪郭抽出対象である船
032 船031の近くに写っている別の船
051 船031の概略形状
081、091、161、244、303、331 チャイルドブロック
082、093、121、162、245、311、321 ペアレントブロック
114 船032の輪郭の一部
115 船031の輪郭の一部
111、132 チャイルドブロック
112、133 縮小したペアレントブロック
113、122、134 差分
131、135 ラベルデータの境界線の一部
151 ラベルデータの境界
241 画像
242 物体
243 物体242の概略形状
253 パディング処理による拡張領域
301 物体輪郭の一部
302 概略形状の一部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an object image extraction method and an object image extraction program for obtaining an object region in an image.
[0002]
[Prior art]
A technique for extracting a region of an arbitrary object from an image is useful when processing an image, for example, replacing a background with another image. For this purpose, it is necessary to correctly determine the region of the object along its contour.
[0003]
Specifically, the object region is represented by an image called an alpha mask (or shape data). An alpha mask is an image in which different pixel values are set in an area where an object exists (object area) and other areas. An example of the original picture and its alpha mask are shown in FIGS. 3 and 4, respectively. FIG. 4 shows the alpha mask of the right ship 031 shown in the original picture of FIG.
[0004]
In other words, extracting an object is creating an alpha mask. Once the alpha mask is obtained, the background area other than the object area can be easily replaced with another image by referring to it.
[0005]
There is a need for a technique for obtaining an accurate shape of an object based on the approximate shape when the approximate shape of the object is tentatively obtained in advance by some method during such object extraction. As one of the methods, an object extraction method (fractal method) using a self-similar map has been proposed (see, for example, Patent Document 1, Patent Document 2, and Non-Patent Document 1). The outline of this technique will be described with reference to FIGS. 5, 6, 7, and 8.
[0006]
FIG. 5 shows a state in which a schematic shape 051 is given to the ship 031, and its alpha mask is FIG. 6. At this stage, the contour of the alpha mask is shifted from the contour of the object. In the fractal method, for such input of original image data and an alpha mask, first, a plurality of square blocks are set along the general shape of the object using the alpha mask. These blocks are called child blocks. Then, a child block is set at the same position in the original image data as in the alpha mask. FIG. 7 shows a child block set in the original image data. For easy understanding, the rough shape is also shown in the original image data.
[0007]
Next, a parent block corresponding to each child block is obtained using the original image data. The size of the parent block is twice the height and width of the child block, and the image pattern (design) in the parent block is the same as the image pattern in the child block.
[0008]
In order to find a parent block similar to the child block pattern, a double-vertical block is set as a candidate block near the child block on the original image data. Then, the error between the reduced block and the child block obtained by reducing the candidate block to 1/2 in the vertical and horizontal directions is obtained.
[0009]
In the case of a grayscale image, for example, an absolute value error (the absolute value of the difference between each pixel is added to all the pixels in the block) is used as the error. Such error evaluation is performed on several candidate blocks, and the candidate block having the smallest error from the child block is determined as the parent block. Such parent blocks are obtained for all the child blocks shown in FIG.
[0010]
FIG. 8 is an example of the parent block 082 obtained for the child block 081 set at the tip of the ship 031. It can be seen that the symbols in each block are similar. Although a binary image is shown in FIG. 8, the same applies to a grayscale image in which 256-level pixel values are given to pixels.
[0011]
With the above processing, data of a child block and a parent block with a similar pattern can be obtained. Next, set the parent block at the same position of the alpha mask as the original image data. To do.
[0012]
The object extraction is performed by correcting the alpha mask using the child block and the parent block. Specifically, the alpha mask data of each child block may be replaced with the alpha block data of the parent block corresponding to each child block reduced to 1/2 in the vertical and horizontal directions.
[0013]
When this replacement conversion (self-similar mapping) is performed once, the approximate shape slightly approaches the correct shape. The same replacement conversion is performed again on the approaching alpha mask. In this way, when the conversion is recursively replaced with the alpha mask, it converges to a substantially correct shape. An alpha mask that has been subjected to replacement conversion a certain number of times is taken as the object extraction result.
[0014]
[Patent Document 1]
JP 2000-82145 A
[0015]
[Patent Document 2]
JP 2001-188910 A
[0016]
[Non-Patent Document 1]
Ida, Sanbonsugi, “Contour Fitting by Self-Similar Mapping”, Proceedings of the 5th Image Sensing Symposium, C-15, pp. 115-120, June 1999.
[0017]
[Problems to be solved by the invention]
However, in the conventional fractal method, when another object is nearby, the contour of the other object may be extracted. In addition, when the object shape is thin, the object shape may disappear, and the object shape may not always be extracted accurately.
[0018]
Therefore, an object of the present invention is to provide a method and program that can accurately extract the shape of an object even when another object is nearby or the object shape is thin.
[0019]
[Means for Solving the Problems]
In order to solve the above-mentioned problem, the object image extraction method according to the present invention includes a first step of receiving image data including a target object to be extracted and shape data representing a region of a schematic shape of the target object in the image data. A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the shape data, and each search reference block being larger than the search reference block A third step of searching for a similar block in which the design of the area corresponding to this block on the image data is most similar to the design of the area corresponding to the search reference block on the image data; The shape data of the region corresponding to each search reference block is changed to the shape data of the region corresponding to each similar block. A fourth step of repeatedly performing the replacement with the reduced one until a predetermined condition is satisfied, and the first step represents the certainty that the target object exists in each pixel in the image data The label data is also received, and in the third step, a weighted sum of errors of the entire block is calculated by referring to the label data and ignoring or neglecting an error between pixels that are unlikely to have a target object. A search is performed for a similar block that minimizes the weighted sum.
[0020]
In addition, the shape data represents a region of a schematic shape of the target object, and each pixel thereof has a one-to-one correspondence with each pixel of the image data, and the label data includes the image data as the target object. It is assumed that the region is divided into at least two types out of three types: a fixed region, a non-target object fixed region, and an undetermined region, and each pixel corresponds to each pixel of the image data on a one-to-one basis. In step 3, for each of a plurality of candidate blocks that are candidates for the similar block, data in a region corresponding to the search reference block in the image data, and data obtained by reducing a region corresponding to the candidate block in the image data; The error of each corresponding point is calculated, and the weighted sum is calculated in the region where both of the corresponding points are classified into the target object determination region by the label data. If both are present in a region that is classified as a non-target object determination region, the error about the corresponding point is ignored or neglected, and the candidate block that minimizes the weighted sum of the error is It is good also as a feature to determine as a similar block.
[0021]
In the third step, for each of a plurality of candidate blocks that are candidates for the similar block, data in a region corresponding to the search reference block in the image data and a region corresponding to the candidate block in the image data are obtained. The error of each corresponding point with the reduced data is calculated, and the weighted sum is calculated when both the corresponding points are present in the region classified as the target object determination region by the label data, or both are non-target objects. If it exists in a region classified as a definite region, a weighting factor to be multiplied by the error for the corresponding point is determined as 0 or a small value, and a candidate block with the smallest weighted sum of the errors is determined as the similar block It may be characterized by.
[0022]
The object image extraction method of the present invention includes a first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data, and the shape data. A plurality of search reference blocks are set so as to be shifted from each other along the outline of the outline shape, and a pattern of an area corresponding to the search reference block on the shape data is thin of the target object. The pattern of the portion is a second step of canceling the setting, and each search reference block is larger than the search reference block, and the design of the area corresponding to that block on the image data is the search reference block A third step of searching for a similar block most similar to the pattern of the region corresponding to, and in the shape data Yes serial processing for replacing the data of the region corresponding to each search criterion blocks obtained by reducing the data of the region corresponding to each of the similar block, and a fourth step of performing repeated until a predetermined condition is satisfied In the second step, the number of changes in the pixel value is obtained by scanning the circumference of the region corresponding to the search reference block on the shape data, and when the number of changes exceeds two, the shape data It is determined that the pattern of the area corresponding to the search reference block above is a pattern of a thin portion of the target object. It is characterized by that.
[0024]
The object image extraction method of the present invention includes a first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data, and the shape data. A second step of setting a plurality of search reference blocks to be shifted from each other along the outline of the approximate shape, and each search reference block is larger than the search reference block and is on the image data A similar block whose pattern in the area corresponding to the block is most similar to the pattern in the area corresponding to the search reference block is searched, and the pattern in the corresponding area on the shape data is a pattern of a thin portion of the target object. A third step of canceling the setting of the similar block and the search reference block corresponding thereto, and the shape data Yes the processing for replacing the data of the region corresponding to each search criterion blocks obtained by reducing the data of the region corresponding to each of the similar block in data, and a fourth step of performing repeated until a predetermined condition is satisfied In the third step, the number of changes in the pixel value is obtained by scanning the circumference of the area on the shape data corresponding to the similarity block. If the number of changes exceeds 2, the similarity is determined. Determining that the pattern of the area on the shape data corresponding to the block is a pattern of a thin portion of the target object; It is characterized by that.
[0026]
The object image extraction method of the present invention includes a first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data, and the shape data. A second step of setting a plurality of search reference blocks to be shifted from each other along the outline of the approximate shape, and each search reference block is smaller than the search reference block and on the image data A third step of searching for a similar block whose pattern corresponding to the block most closely resembles the pattern of the area corresponding to the search reference block; and data of areas corresponding to the similar blocks in the shape data, respectively The process of replacing the data in the area corresponding to the search reference block with the reduced data satisfies the predetermined condition. Characterized by a fourth step of performing repeatedly.
[0027]
The object image extraction method of the present invention receives image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data, and expands these to expand image data and an enlarged image data. A first step of generating shape data; a second step of setting a plurality of search reference blocks by shifting their positions along the outline of a schematic shape represented by the enlarged shape data; and the search For each reference block, a third block is searched for a similar block which is larger than the search reference block and whose symbol on the enlarged image data is most similar to the symbol of the region corresponding to the search reference block. Step, and the data of the area corresponding to each similar block in the enlarged shape data to each search reference block The fourth step of repeatedly replacing the data in the corresponding area with the reduced data until a predetermined condition is satisfied, and the fifth step of reducing the enlarged shape data obtained in the fourth step to the original size And a step.
[0036]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, a plurality of embodiments of the present invention will be described with reference to the drawings.
[0037]
(Items Common to Each Embodiment) FIG. 40 is a diagram of a PC (personal computer), WS (workstation), etc. used in each embodiment of the present invention. The PC and WS used in each embodiment include an input device 4007 such as a pointing device such as a mouse, a keyboard, and other external devices (for example, a digital camera), an input reception unit 4004 that receives input from the input device 4007, a CRT, and an LCD. And an image output unit 4006 for outputting an image signal thereto.
[0038]
The PC and WS used in each embodiment include a magnetic disk drive 4002 such as a hard disk, a memory 4005, a central processing unit 4001, and an optical disk drive 4003.
[0039]
Each of the embodiments of the present invention is an object image extraction program that runs on a PC (personal computer) or WS (workstation). The user reads a program stored in advance in the magnetic disk drive 4002 into the memory 4005 and causes the PC or WS to execute it.
[0040]
Before executing the object image extraction program, the user acquires image data to be subjected to object shape extraction processing and stores it in the magnetic disk drive 4002 in advance. At the time of execution, the object image extraction program reads this image data from the magnetic disk drive 4002 and stores it in the memory 4005.
[0041]
Then, the image data is displayed on the display device 4008, and the user is requested to input the alpha mask data of the approximate shape specifying the approximate shape of the object by using the mouse. The input alpha mask data is also stored in the memory 4005.
[0042]
Further, the object image extraction program extracts the object shape based on the image data and the alpha mask data of the approximate shape. By extracting the object shape, an alpha mask having an accurate shape is generated and output as an extraction result.
[0043]
The alpha mask of the contour extraction result is stored in the magnetic disk drive 4002 or the memory 4005 provided in the PC or WS. For example, it is used in another program or apparatus that cuts out an image of an object from an image.
[0044]
Note that a camera may be connected to a PC or WS so that the user can acquire an image at an arbitrary timing. Further, the data of the substantially shaped alpha mask may be automatically generated using a background difference method or the like.
[0045]
In the following description, the search reference block is referred to as a child block, and a similar block that is larger than the search reference block (for example, twice in the vertical and horizontal directions) and similar in design is referred to as a parent block.
[0046]
(First Embodiment) This embodiment is to improve that the object shape may not be accurately extracted when there is an edge such as another object contour in the vicinity of the contour extraction target object. .
[0047]
Hereinafter, the processing of this embodiment will be described with reference to the flowchart of FIG.
[0048]
(Step 010) Image data, a substantially shaped alpha mask, and label data are prepared on a memory.
[0049]
As the image data, for example, image data that has been previously captured by a user with a digital camera or the like and stored in a hard disk is read out.
[0050]
The alpha mask is data representing the shape of an object created by the user specifying, for example, a mouse while viewing the image data displayed on the image display device. The alpha mask is data having the same number of pixels as the image data. The pixel value is 1 when the object is present and the pixel value is 0 when the object is not present.
[0051]
The label data is data representing information related to an object area and a background area different from the alpha mask, and is created by a user using a mouse while viewing image data. For each pixel, for example, a region that is known to be an object other than the background or the object in advance is a non-target object determination region (background determination region), and the pixel value of each pixel is 0, and the region is known to be an object in advance. , The pixel value of each pixel is set to 1 as the target object fixed region (object fixed region), and the pixel value of each pixel is set to 2 as the undefined region for the background or the object. The label data may be automatically generated with reference to, for example, an alpha mask.
[0052]
(Step 011) The child block C is set in the contour portion of the alpha mask. In the present embodiment, the child blocks C are set so as to overlap each other as shown in FIG. 7, but may be set so as to contact each other without overlapping. The position information (for example, the coordinates of the upper left corner and the coordinates of the lower right corner) of the set child block C is stored in the memory.
[0053]
(Step 012) A parent block P which is a block similar to each child block is found with reference to label data and image data.
[0054]
First, a candidate block that is a parent block candidate is set in the vicinity of the child block. Then, on the image data, the error is obtained by referring to the label data of the child block region pattern and the candidate block region pattern. An error is calculated for a plurality of candidate blocks, and a block having the smallest error is defined as a parent block. Since the candidate block is a block having the same number of pixels as the parent block, when the error between the child block and the candidate block is obtained, the candidate block is reduced to have the same number of pixels as the child block.
[0055]
The error calculation with reference to the label data is performed as follows. For example, when the user designates the area inside the area 151 in FIG. 15 as an area in which the object is not extracted, the label data has a pixel value of 0 inside (background determined area), and the other pixel values of 2 (undefined area) ). And the pixel with the child block is X c , The pixel of the corresponding reduced block is X p X c And X p Is defined as follows. (1) X c And X p When both are within the background determination area, c And X p “0” is ignored.
(2) X c And X p When both are within the object determination area, c And X p “0” is ignored.
(3) If neither (1) nor (2) above, c And X p Error "=" X c And X p The absolute value of the difference between the pixel values of ".
[0056]
X obtained in this way c And X p Are added to each other in the block to obtain an error between the candidate block and the child block. Then, the candidate block with the smallest error is determined as the parent block. Then, the determined parent block position information is stored in the memory in association with the child block.
[0057]
(Step 013) Step 012 is repeated until parent blocks for all child blocks are determined.
(Step 014) On the alpha mask, the data of the area corresponding to each child block is replaced with the data of the parent block corresponding to the child block reduced to the same number of pixels as the child block.
(Step 015) Step 014 is performed for all child blocks. As a result, all child blocks of the alpha mask are replaced once.
(Step 016) Steps 014 and 015 are recursively repeated a predetermined number of times. Thereby, the contour of the alpha mask asymptotically approaches the contour of the object.
[0058]
In the error calculation in step 12, in the cases (1) and (2), the error is ignored and set to 0. However, even if the error is neglected, that is, multiplied by a predetermined coefficient larger than 0 and smaller than 1, good. Alternatively, in the cases (1) and (2), the calculation itself may be omitted ignoring the error.
[0059]
Hereinafter, an example of extracting an object shape by a conventional fractal method and an example of extracting an object shape according to the present embodiment will be compared.
[0060]
An example will be described in which an object shape is extracted using a conventional fractal method when another object is nearby. The child block 091 shown in FIG. 9 includes the area of the upper left ship 032 in addition to the area of the lower right ship 031. In this case, there is a high possibility that a candidate block that is completely similar to the child block 091, that is, the absolute value error is 0, is not found, but the candidate block with the smallest error is selected as the parent block.
[0061]
In order to extract the ship 031, it is convenient to select a block 093 similar to the area of the ship 031 as the parent block. This is because the contour of the alpha mask converges to the contour of the ship 031 by the replacement conversion. However, the block 093 is not necessarily selected.
[0062]
FIG. 11A is an enlarged view of the periphery of the child block 091, and shows a parent block candidate block 093, a contour 114 of the ship 032, and a contour 115 of the ship 031. In FIG. 11A, parent block candidate block 093 is set to be similar with respect to contour 115 of ship 031.
[0063]
FIG. 11B shows an image pattern 111 of the child block 091, an image pattern 112 obtained by reducing the block 093, and a difference pattern 113 between the image pattern 111 and the image pattern 112.
[0064]
Here, the pixel values of the area of the ship 032 and the area of the ship 031 painted with horizontal lines are set to the same value, and the other areas are set to be constant with different pixel values. In the difference pattern 113, a portion where an error in pixel values occurs in the image pattern 111 and the image pattern 112 is painted black. The absolute value error is proportional to the area of this black region.
[0065]
On the other hand, FIGS. 12A and 12B show a case where the block 121 which is a parent block candidate is set to be similar with respect to the contour 114. In this case, the area of the black region of the difference pattern 122 is smaller than that of the difference pattern 113 in FIG. As a result, as shown in FIG. 10, the block 121 is selected as the parent block, and the contour of the alpha mask of the ship 031 approaches the ship 032 due to the replacement conversion for this portion, so that a correct contour cannot be obtained.
[0066]
On the other hand, a parent block convenient for object extraction is selected by processing using label data as in step 012. This will be described using an example in which an alpha mask as shown in FIG. 4 is generated from the original image shown in FIG.
[0067]
FIG. 5 shows a state in which a rough shape of an object is given, and FIG. 6 shows an alpha mask of this rough shape. FIG. 7 shows the result of arranging child blocks.
[0068]
FIG. 13A is an enlarged view of the periphery of the child block 091. FIG. The contour 114 is the contour of the ship 032, and the contour 115 is the contour of the ship 031. The parent block 093 is arranged so as to be similar with respect to the ship 031 outline 115. The upper left side of the background determination area line 131 that is the boundary line of the background determination area is the background determination area 151 shown in FIG.
[0069]
FIG. 13B shows an image pattern 132 of the child block 091, an image pattern 133 of the parent block 093 (reduced to the same size as the child block), and a difference pattern 134 between the image pattern 132 and the image pattern 133. It is a figure.
[0070]
In FIG. 13B, the image pattern 132 and the image pattern 133 also show a background determination area line 131, and the difference pattern 134 includes a common area between the background determination area in the image pattern 132 and the background determination area in the image pattern 133. The boundary line 135 is also shown.
[0071]
As described with reference to FIGS. 11A and 11B, in the conventional arrangement of such parent blocks, many errors have occurred on the upper left side. However, in the present embodiment, in both the image pattern 132 and the image pattern 133, the error of the pixel that is the background determination region is zero, so that no error appears in the region on the upper left side of the boundary line 135 of the difference pattern 134. . Therefore, the error in the entire block is reduced as in the difference pattern 134 as compared with the conventional case.
[0072]
FIGS. 14A and 14B are diagrams in the case where the parent blocks are arranged so as to be similar with respect to the contour 114 of the ship 032 as in FIGS. 12A and 12B. In this case as well, the error on the upper left side of the line 135 is canceled as in the case of FIG. 13. However, since there is no error on the upper left side of the line 135, the error on the lower right side as a whole is the same as in the case of FIG. An error occurs.
[0073]
Comparing FIG. 13 and FIG. 14, in this embodiment, the case of FIG. 13 has a smaller error than the case of FIG. 14, and the parent block so as to be self-similar with respect to the case of FIG. Is selected, the contour of the ship 031 is correctly extracted.
[0074]
In the present embodiment, the label data is specified in advance by the user using the mouse, but the label data may be obtained by using a method for automatically obtaining the label data described below.
[0075]
In this embodiment, step 014 and step 015 are repeated a predetermined number of times, but the condition for repetition is not limited to “number of times”. For example, when the replacement is performed in step 015, the sum of the absolute value difference between the alpha mask of the child block and the reduced alpha mask of the parent block is calculated, and the calculation is repeated until the sum of the absolute value differences becomes a predetermined threshold value or less. You may do it.
[0076]
(First Label Data Generation Method) For example, when the color of an object or the color of a background is known in advance, there is also a method in which the color areas are set as an object determination area and a background determination area, respectively.
[0077]
This method will be described by taking as an example the case where the schematic shape 051 is given as described above.
[0078]
(1) The shape 371 is obtained by expanding the schematic shape 051 with a constant width W as shown in FIG. Similarly, the shape 372 is obtained by inflating with a width of 2 W.
[0079]
Here, dilation is a type of processing by a morphological filter. When a pixel other than the processing target region (here, the object region) is scanned and the processing target region is within a certain distance from the target pixel, that pixel is used. Is a process of adding to the processing target area.
[0080]
(2) The general shape 051 is contracted by a width of W and 2W to obtain a shape 373 and a shape 374, respectively.
[0081]
Here, contraction is also a type of processing by the morphological filter. When there is a region other than the processing target region within a certain distance from the target pixel while scanning the pixel of the processing target region, processing for removing the pixel from the processing target region It is.
[0082]
(3) A region 381 sandwiched between the shape 371 and the shape 372 (a region indicated by hatching in FIG. 38) is set as a background color sampling region. In addition, a region 382 (region indicated by a horizontal line in FIG. 38) sandwiched between the shape 373 and the shape 374 is a foreground color sampling region. Here, the reason why the colors are sampled from the portion away from the approximate shape 051 by a certain distance is that the approximate shape is deviated from the correct shape.
[0083]
(4) A background color table is created by extracting all the colors of the pixels in the background color sampling area in the original image. Similarly, a foreground color table is created.
[0084]
Instead of extracting all the colors, when a certain number of pixels are the same color, the colors may be registered.
[0085]
(5) The background color table and the foreground color table are compared, and if the same color is registered, the color is removed from both tables.
[0086]
(6) Each pixel of the original image is scanned using the two color tables obtained in this way. Then, label data is created by setting the color pixel in the background color table as the background determination area, the color pixel in the foreground color table as the object determination area, and the color pixel not in any table as the undetermined area.
[0087]
By doing as said (1)-(6), the area | region which can be estimated with a background or an object from a viewpoint of a color can be made into each definite area | region.
[0088]
Rather than registering similar colors individually, if the color level is created beforehand and the label data is created after the color level of the original image is quantized in advance, the number of colors handled will be reduced and the amount of processing can be reduced. Contributes to faster processing.
[0089]
(Second Label Data Generation Method) Locally optimized information can be obtained by creating a color table locally on the screen and creating label data while switching each.
[0090]
As an example of creating a color table locally, the following method can be considered. For example, as shown in FIG. 39, blocks 391, 392 and the like are arranged along a schematic shape 051, and the above-described color table is created only inside each block. Then, when creating the label data, it is determined whether the background is determined, the object is determined, or is not yet determined using the color table of the block to which each pixel belongs. At that time, in the portion where the blocks 391 and 392 overlap, first, a label is determined by the color table of one of the blocks, and if the label is undecided, the label is reattached by the other color table.
[0091]
(Third Label Data Generation Method) When generating a background color table or an object color table, a method of registering and generating the color of a pixel that indicates a screen as a background or object instead of using a morphological filter is also available. is there.
[0092]
(Third label data generation method) When a background image in which an object to be contour extracted is not captured can be acquired in advance, a difference between the background image and the current image is obtained, and pixels with a difference equal to or greater than a certain value are detected. There is also a method of confirming.
[0093]
(Fourth Label Data Generation Method) When it can be assumed that there is a correct contour within a certain range from the contour of the general shape, the result of contracting the background region of the general shape is used as the background determination region, or the object of the general shape The result of contracting the region can also be used as the object determination region. With this method, the periphery of the processing target area is reduced.
[0094]
(Fifth label data generation method) When it is known that the object area of the approximate shape always includes the entire object, the background area is determined by using the background area of the approximate shape as it is or by contracting one or two pixels. This is an area. On the other hand, an object region having a substantially shaped shape is defined as an object determination region by contracting several pixels, for example, about ½ of the number of pixels on one side of a child block.
[0095]
Furthermore, the object determination area and the background determination area determined in this way may be expanded using the area growth method. On the other hand, the same applies to the case where the entire object region having a substantially shape is always included in the object.
[0096]
Here, the area growth method compares the pixel values inside and outside the area at the boundary of the growth target area, and if the difference between the pixel values is less than a certain value, the outside pixel is taken into the area. It is to go. By repeating this process, a portion having a close pixel value is taken into the region.
[0097]
(Sixth Label Data Generation Method) When one point on the object is input by the user, the object region may be obtained by the region growth method using that point as a starting point, and may be used as the object determination region. Similarly, for the background, the background definite region can be set using the region growing method.
[0098]
(Number of stages of label data) In the label data generation method up to this point, an example has been described in which background determination, object determination, and undecided three-stage data are generated, but the number of stages may be increased. For example, the pixel value of the label data is brought closer to 0 as the probability of being the background is higher, the pixel value is brought closer to 255 as the probability of being the object is higher, and the undetermined region is considered to correspond to the pixel value 128.
[0099]
The background and object colors are examined in some way (for example, by the background color sampling and object color sampling methods in the first label data generation method described above). Then, label data is generated by determining the pixel value of the label data according to whether each pixel is closer to the background or the color of the object.
[0100]
In the parent block search using the label data generated in this way, the pixel value of a pixel having a child block is set to X c , The pixel value of the reduced block pixel of the parent block candidate is X p , "X c And X p The absolute value of the difference between the pixel values of E is E, and the weighting coefficient for error calculation is W.
"X c And X p Error "= W x E
Is calculated for each pixel to obtain the sum, and “X c And X p The one with the smallest error is adopted as the parent block.
[0101]
Here, the weighting factor W is
(A) X c And X p When the pixel values of both of the label data are not close to 0 or 255, they are always kept at 1.
(B) X c Or X p When the pixel value of any one of the label data is close to 0, the weighting factor W is made smaller than 1 as the other label is smaller.
(C) X c Or X p When the pixel value of any one of the label data is close to 255, the weighting factor W is made smaller than 1 as the other label is larger.
[0102]
By controlling W in this way, it is possible to reduce the influence of errors between pixels having a high probability of being an object and pixels having a high probability of being a background in multiple stages.
[0103]
As described above, in the present embodiment, by using the masking information called label data when extracting the contour of the object, the contour can be accurately extracted even when a plurality of objects are close to each other.
[0104]
(Second Embodiment) A second embodiment of the present invention will be described below with reference to FIGS. This embodiment is an embodiment that is effective when a plurality of objects are extracted sequentially one after another. Here, the description will focus on the parts different from the first embodiment.
[0105]
In the image shown in FIG. 3, there are a ship 032 and a ship 031. In this embodiment, these contours are sequentially extracted. Here, first, the ship 032 is extracted by the method described in the first embodiment, and then the ship 031 is extracted.
[0106]
FIG. 26 is a diagram in which the object region 261 of the ship 032 extracted by the method described in the first embodiment is blacked out. For this situation, as in the first embodiment, the schematic shape is set as shown in FIG. 5, and the child blocks are arranged as shown in FIG.
[0107]
And the pixel value of a pixel with a child block is set to X c , The pixel value of the corresponding pixel of the reduced block is X p X c And X p The error calculation formula is
(1) X c Or X p When one of the two is within the area 261, “X c And X p Error ”=“ 0 ”
(2) If the above (1) is not met, c And X p Error ”=“ X c And X p Absolute value of difference in pixel value from
Define as follows.
[0108]
By defining in this way, the error is not counted in the horizontal line region at the upper left of the image pattern 112 in FIG. 11, the error of the block 093 becomes zero, and this is selected as the parent block. That is, the error calculation formula is such that a parent block 093 similar to the child block 091 in FIG.
[0109]
As described above, according to the present embodiment, when the contours of a plurality of objects are sequentially extracted, the detected objects are masked using information on the contours of the already detected objects, so that the plurality of objects are close to each other. However, it is possible to accurately extract the contour of the object.
[0110]
(Third Embodiment) A third embodiment of the present invention will be described with reference to the drawings. Conventionally, the present embodiment is intended to solve the problem that it is difficult to detect the contour when the object region is thin. Here, the description will focus on the parts different from the first embodiment.
[0111]
In the conventional fractal method, it is difficult to perform object extraction when the object shape is thin, such as around the child block 161 in FIG.
[0112]
There is no completely similar parent block for the child block 161 arranged in the narrow portion. For the child block 161, for example, the block 162 is selected as the parent block.
[0113]
When the child block 161 and the parent block 162 are used to perform replacement conversion from the parent block 162 to the child block 161 for the alpha mask of the approximate shape 051, the width of the object region of this part is reduced to 1/2 each time. If the replacement conversion is repeatedly performed, the object region will eventually disappear.
[0114]
This embodiment can cope with the above-mentioned problem. Hereinafter, the flow of processing in the present embodiment will be described with reference to the flowchart of FIG.
[0115]
(Step 020) The same processing as step 010 of the first embodiment is performed.
[0116]
(Step 021) Child blocks are arranged along the outline of the outline-shaped alpha mask as shown in FIG.
(Step 022) Of the child blocks arranged in step 021, those determined to be arranged in a thin portion of the object are removed. A method for determining whether or not a thin portion will be described later.
[0117]
(Step 023) A parent block similar to the child block not canceled in step 022 is found with reference to the image data. In the present embodiment, similar blocks are obtained while referring to label data as in the first embodiment.
(Step 024) Step 023 is repeated until parent blocks for all child blocks are determined.
[0118]
(Step 025) On the alpha mask, the data of the area corresponding to each child block is replaced with the data of the area of the corresponding parent block reduced to the same number of pixels as the child block.
(Step 026) Step 025 is performed for all child blocks. As a result, all child blocks in the alpha mask are replaced once.
(Step 027) Steps 025 and 026 are recursively repeated a predetermined number of times. Thereby, the contour of the alpha mask asymptotically approaches the contour of the object.
[0119]
In this embodiment, label data is used, but it is not essential. It is not necessary to use label data as in the past.
[0120]
By processing in this way, since the child block is not arranged in the thin object portion, the problem that the portion disappears can be avoided in many cases.
[0121]
The determination in step 022 as to whether or not the object is a thin portion is performed using the pixel value in the alpha mask of the child block to be determined. Hereinafter, a specific processing method will be described with reference to FIGS. 18, 19, 20, 21, and 22.
[0122]
FIG. 18 is an enlarged view of an alpha mask of a child block of 16 × 16 pixels. White pixels represent the object, and black pixels represent the background.
[0123]
The child block alpha mask is scanned one pixel at a time from the upper left pixel to the upper right pixel, and the number of pixel value changes is counted. Further, four sides are scanned from the upper right end pixel to the lower right end pixel, the lower right end pixel to the lower left end pixel, and the lower left end pixel to the upper left end pixel, and all the changes are counted.
[0124]
The number of changes required in this way is always an even number. And when the frequency | count of a change is 4 times or more, it determines with there being a thin part of an object.
[0125]
In the case of FIG. 18, the scanning from the upper left pixel to the upper right pixel and the scanning from the lower right pixel to the lower left pixel each change twice from black to white and from white to black. Since it is a total of 4 times, it is determined to be a thin portion.
[0126]
Since the child block is arranged along the outline of the general shape, when the periphery of the block is scanned in this way, if it is not a thin portion, the number of changes as shown in FIG. 21 is usually two. When the number of changes is two, it can be extracted by the fractal method.
[0127]
When the number of changes is more than 2, it is estimated that the shape is a complicated shape or a thin portion. In the case of complicated shapes, the fractal method often cannot cope.
[0128]
FIG. 19 shows an example in which the number of changes is 6 and FIG. 20 shows an example in which the number of changes is 4. In such a case, since there is no self-similarity, it is considered better to avoid extinction of the object region by canceling the child block and leaving the approximate shape as it is without forcibly applying the fractal method.
[0129]
In the case shown in FIG. 22, the number of changes is 0. In this case, the white object region disappears due to replacement conversion. If this small object is noise and can be eliminated, the child block can be left as it is, but if it is known that this is a small object, the user can specify it with the mouse, etc. Give this information to cancel this child block.
[0130]
In the above example, four sides of the child block are scanned in step 022. Although this method is simple and easy, the disappearance of a thin object portion cannot be completely avoided.
[0131]
For example, even if the child block pattern is FIG. 21 (a), if the parent block is the one shown in FIG. 20 (a), the child block is overwritten by one replacement conversion, and the replacement conversion is performed. The object region disappears by repeating the above.
[0132]
In order to avoid such a situation, a parent block is first obtained, and four sides of the parent block are scanned to count the number of changes in the pixel value of the alpha mask. If the number of changes is greater than 2, the parent block and child block are canceled.
[0133]
A flowchart in this case is shown in FIG. Except for the step 234 for removing the child block and the parent block, the process is the same as in FIG.
[0134]
FIG. 17 is a diagram illustrating an example of the positional relationship between the child block 161 and the parent block 162. So far, the example of scanning the four sides of the child block 161 and the example of scanning the parent block 162 have been described.
[0135]
In addition, the four sides of the block 163 that shares the center with the child block and has the same size as the parent block 162 may be scanned, and similarly, it may be determined whether or not the portion is a thin portion depending on the number of changes. In the case of the block 163, since the determination can be made before the parent block search, the processing amount can be reduced. Further, a result closer to the determination using the parent block 162 than using the child block 161 is obtained.
[0136]
As described above, in this embodiment, the pixels on the four sides of the parent block are scanned, the shape of the object included in the parent block is estimated, and it is determined whether or not to perform the replacement process. It is possible to leave a contour such as a thin part or a part having a complicated shape.
[0137]
(Fourth Embodiment) An object region that disappears by repetition of replacement conversion is an object region having a shape narrower than the width of the parent block. Therefore, in order to avoid the disappearance of the object area, the tolerance of the schematic shape is reduced, but it is considered that the parent block and the child block should be reduced.
[0138]
However, when the child block is originally a small block such as 4 × 4 pixels, if it is made smaller than this, the resolution becomes coarse and an image pattern sufficient to use self-similarity cannot be obtained.
[0139]
Therefore, in this embodiment, disappearance is avoided by enlarging the original image and the schematic shape without changing the size of the parent block, and making the object region thicker than the width of the parent block. If necessary, the extracted alpha mask is reduced to the original size.
[0140]
A flowchart of this embodiment is shown in FIG. The difference from the previous embodiments is that step 271 for enlarging the original image and the schematic shape is performed at the very beginning of the processing. The enlargement of the original image in step 271 is performed using, for example, zero-order interpolation, linear (primary) interpolation, or a higher-order pixel interpolation method. For enlargement of the approximate shape, which is an alpha mask, for example, zero-order interpolation is used. Subsequent steps are the same as those in the previous embodiments, and a description thereof will be omitted.
[0141]
As described above, in this embodiment, the contour is extracted by enlarging the original image. Therefore, the contour of a thin part of an object can be accurately extracted even if the shape is likely to disappear in the conventional contour extraction processing method. It becomes like this.
[0142]
(Fifth Embodiment) This embodiment relates to an outline extraction process suitable for extracting the outline of an object at the edge of an image.
[0143]
In the fractal method, high extraction accuracy may be obtained by padding a certain width outside the original image. For example, as shown in FIG. 24, it is assumed that an object 242 exists in a hatched portion in the original image 241 and a rough shape 243 slightly deviated from the outline of the object 242 is given.
[0144]
In the case of the child block 244 arranged as shown in FIG. 24, in order to bring the schematic shape 243 closer to the contour of the object 242, the parent block is positioned so that the image pattern inside thereof is similar to the child block. It is desirable to arrange in block 245.
[0145]
Since the parent block search is performed within a certain range centered on the child block, it is sufficient that the block 245 exists in the range. However, in the case of FIG. 24, the right side of the block 245 protrudes from the image. Therefore, even if the block 245 is within the search range, error evaluation is not performed and it is excluded from the parent block candidates. Therefore, in the child block 244 portion, a block different from that shown in the figure is selected as the parent block, and the contour cannot be obtained accurately.
[0146]
Therefore, in the present embodiment, the image is expanded in advance to the extent that there is a possibility of becoming a search range, as in a region 253 indicated by a horizontal line in FIG. This is called padding.
[0147]
In the present embodiment, the padding pixel value is extrapolated by the outermost pixel value of the image, and the position and width for padding are determined as follows.
[0148]
When it is known in advance that the child block is arranged on the outline of the approximate shape, a rectangle 251 circumscribing the approximate shape 243 is first obtained prior to object extraction. If the rectangle 251 is obtained, the outer frame 252 of the portion that can be the parent block search range when the child block is arranged around the inside is determined.
[0149]
The inside of the outer frame 252 may calculate an error as a candidate block when searching for a parent block. Therefore, padding is performed for the width of the outer frame 252 beyond the image 241. At this time, padding is not required for the portion where the outer frame 252 does not protrude, such as the upper left or lower right side of the image 241, but if there is no particular limitation on the memory capacity for storing the image data, Padding with a sufficient width may be performed on all the left and right sides. By padding the outside of the image in this way, it is possible to avoid the problem that the contour line near the edge of the image cannot be accurately extracted.
[0150]
FIG. 28 is a flowchart of the object extraction process of this embodiment. At the beginning of object extraction by the so-called fractal method, step 281 is executed to perform padding. Other steps are the same as in the previous embodiments.
[0151]
As described above, in the present embodiment, by providing padding with a predetermined width outside the original image, the contour existing at the edge of the image can be accurately extracted.
[0152]
(Sixth Embodiment) This embodiment is an embodiment relating to the contour extraction process in the case where there is a large deviation between the approximate shape and the correct shape.
[0153]
FIG. 30 is an example of a case where an object contour cannot be correctly extracted by the conventional fractal method. FIG. 30 is a diagram showing a contour 301 of an object, its approximate shape 302, and a child block 303 that is one of the child blocks arranged so that the center is located on the contour of the approximate shape 302.
[0154]
Since the child block 303 does not include the object contour 301, for example, the block 311 shown in FIG. 31 is selected as a similar block to the child block 303 in the parent block search. Thus, when the gap between the approximate shape and the correct shape is large, the self-similar structure of the object cannot be extracted, and as a result, the contour of the object may not be extracted correctly.
[0155]
Therefore, in this embodiment, the parent block is arranged first. This is shown in FIG. 32 and FIG. First, the parent block is arranged so that the center is located on the outline of the schematic shape 302 as in the block 321 of FIG. Then, a 1/2 vertical and horizontal block similar to the parent block is searched.
[0156]
In this case, the object outline 301 is included in the lower left of the block 321. Therefore, when a vertical and horizontal ½ block similar to the block 321 is searched, the block 331 is selected as a child block as shown in FIG.
[0157]
FIG. 29 is a flowchart of the contour extraction process of the present embodiment. Steps 291 to 293 are processing for searching similar child blocks by arranging the parent blocks first. Subsequent replacement processing is the same as that of the previous embodiment.
[0158]
(Step 291) The parent block P is arranged in the contour portion of the alpha mask. Similar to FIG. 7 showing an example of arranging child blocks, the outlines of the parent blocks P are arranged so that outlines of the outline shape pass, and adjacent parent blocks overlap.
(Step 292) A child block C similar to the parent block P is found.
(Step 293) Step 292 is performed on all parent blocks to determine child blocks.
Since the following is a replacement process similar to the above, description thereof will be omitted.
[0159]
As described above, in the present embodiment, the parent block is first arranged on the outline of the approximate shape, and the child block is searched later, so that the allowable error between the approximate shape and the correct shape is higher than when the child block is arranged first. Therefore, it becomes easier to extract the self-similar structure of the object than before. As a result, the object can be easily extracted correctly.
[0160]
(Seventh Embodiment) This embodiment is an embodiment relating to a contour extraction process suitable for obtaining an alpha mask that also represents an intermediate state between an object region and a background region. Hereinafter, this embodiment will be described.
[0161]
FIG. 36 is a flowchart of contour extraction processing according to this embodiment.
(Step 361) As shown in FIG. 34, the enlarged image data 344 and the enlarged alpha mask 343 are generated by enlarging the image data 342 and the substantially shaped alpha mask 341 at a predetermined magnification. In the present embodiment, the enlargement ratio is doubled vertically and horizontally.
(Step 362) The above-described fractal method is performed on the enlarged image data 344 and the enlarged alpha mask 343 to extract an accurate alpha mask. Here, the pixel value of each pixel of the alpha mask is 0 for the background and 255 for the object.
(Step 363) The alpha mask obtained by the fractal method is reduced to the original size to obtain an alpha mask for the image data 342.
[0162]
FIG. 35 is a diagram for explaining the reduction processing of the enlarged alpha mask to the original size in step 363. In the present embodiment, since the original size image is enlarged twice and vertically and the fractal method is performed, the four pixels 353 of the enlarged alpha mask correspond to the pixels 352 of the alpha mask obtained by reduction. In the present embodiment, the average value of the pixel values of the pixel 353 is used as the pixel value of the pixel 352 of the alpha mask obtained by reduction. Accordingly, the pixel value of each pixel of the alpha mask obtained by reduction is an average value of four pixels.
[0163]
In this embodiment, each pixel of the enlarged alpha mask is given a pixel value of 0 for the background and a pixel value of 255 for the object. Therefore, among the four enlarged alpha mask pixels corresponding to each pixel of the alpha mask obtained by reduction, the average value is 0, 1, 2, 3, and 4, respectively. , 0, 64, 128, 192, 255.
[0164]
In FIG. 35, since the pixel 352 includes two object pixels, the pixel value of the pixel 352 is 128. Further, if the values of the corresponding pixels are all the same as in the pixel 354, the corresponding pixels 351 have the same value.
[0165]
By using the pixel value of each pixel of the alpha mask obtained in this way as the pixel mixture ratio when combining the extracted object with another image, the jagged feeling given by the contour line is improved and more natural composition An image can be obtained.
[0166]
The calculation formula of the pixel value of the composite image is as follows: X is the pixel value of the pixel of the image in which the extracted object is shown, A is the value of the alpha mask corresponding to that pixel, and the pixel at the same position by another image to be combined If the pixel value is Y,
“Pixel value of composite image” = (A × X + (255−A) × Y) / 255
It becomes like this. In this way, the pixel value of each pixel of the alpha mask can be regarded as representing transparency with 0 being completely transparent and 255 being completely opaque.
[0167]
In the above-described enlargement process, pixel interpolation is performed on the image data by, for example, first-order interpolation, and on the alpha mask, for example, by zero-order interpolation. For example, when generating an alpha mask for a reduced image called a thumbnail image, it is not necessary to enlarge the original image, and after generating an alpha mask having values of 0 and 255 at the original size, You can reduce it as you did.
Further, if an image corresponding to transparency, such as image compression standards PNG and GIF, is generated and stored using the image data and the generated alpha mask, for example, it becomes a general-purpose object image and can be reused.
[0168]
As described above, in the present embodiment, when generating an alpha mask by reducing the enlarged alpha mask obtained by enlarging the original image and performing contour extraction, the multistage obtained by referring to the plurality of pixel values of the enlarged alpha mask Is used as each pixel value of the alpha mask. Therefore, by using the pixel value of the alpha mask as the transparency when extracting the object, it is possible to obtain a smooth contour line of the object.
[0169]
【The invention's effect】
As described above, according to the present invention, in the fractal method, the contour of an object can be accurately obtained even when the edge of another object contour or the like is near or the object region is thin.
[Brief description of the drawings]
FIG. 1 is a flowchart of contour extraction processing according to a first embodiment of the present invention.
FIG. 2 is a flowchart of contour extraction processing according to a third embodiment of the present invention.
FIG. 3 shows an example of an extraction target image.
FIG. 4 is an example of an alpha mask for the image of FIG.
FIG. 5 shows a schematic shape set.
FIG. 6 is a schematic shape alpha mask.
FIG. 7 shows the arrangement of child blocks.
FIG. 8 shows an example of a child block and its parent block.
FIG. 9 shows an example of another child block and its parent block.
FIG. 10 is an example in which another parent block is selected in FIG. 9;
11 shows how an error is calculated in FIG.
FIG. 12 shows how an error is calculated in FIG.
FIG. 13 shows an example in which an error is calculated according to the present invention.
FIG. 14 shows another example in which an error is calculated according to the present invention.
FIG. 15 shows an example of inputting label data.
FIG. 16 shows an example in which child blocks are arranged in a narrow portion.
FIG. 17 shows an example of a child block arranged in a thin portion and a surrounding parent block.
FIG. 18 is an alpha mask in a child block.
FIG. 19 shows an example of an alpha mask pattern: the number of changes is 6.
FIG. 20 shows an example of an alpha mask pattern: the number of changes is 4.
FIG. 21 shows an example of an alpha mask pattern: the number of changes is 2.
FIG. 22 shows an example of an alpha mask pattern: the number of changes is zero.
FIG. 23 is a flowchart of a modification of the contour extraction process according to the third embodiment of the present invention.
FIG. 24 shows an example in which an object is at the edge of an image.
FIG. 25 shows an example in which padding is provided at the edge of an image for expansion.
FIG. 26 shows an example in which a first object region is extracted and a mask is set.
FIG. 27 is a flowchart of contour extraction processing according to the fourth embodiment of the present invention;
FIG. 28 is a flowchart of contour extraction processing according to the fifth embodiment of the present invention;
FIG. 29 is a flowchart of contour extraction processing according to the sixth embodiment of the present invention.
FIG. 30 shows an example in which child blocks are arranged.
FIG. 31 shows an example of obtaining a parent block.
FIG. 32 shows an example in which parent blocks are arranged.
FIG. 33 shows an example of obtaining a child block.
FIG. 34 is a diagram for explaining the concept of processing for enlarging image data and an alpha mask.
FIG. 35 is a diagram for explaining the concept of alpha mask reduction processing;
FIG. 36 is a flowchart of contour extraction processing according to the seventh embodiment of the present invention;
FIG. 37 shows an example in which expansion and contraction are performed in a schematic shape.
FIG. 38 is a diagram showing a sampling area when creating a color table.
FIG. 39 shows an example of creating a color table locally.
FIG. 40 is a diagram illustrating a schematic configuration of a computer used in each embodiment of the present invention.
[Explanation of symbols]
031 Ship for contour extraction
032 Another ship in the vicinity of ship 031
051 Outline shape of ship 031
081, 091, 161, 244, 303, 331 Child block
082, 093, 121, 162, 245, 311, 321 Parent block
114 Part of the outline of ship 032
115 Part of the outline of ship 031
111, 132 Child block
112, 133 Parent block reduced
113, 122, 134 Difference
131, 135 Part of the border of the label data
151 Label data boundary
241 images
242 objects
243 Schematic shape of object 242
253 Extension area by padding process
301 Part of object contour
302 Part of rough shape

Claims (14)

抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きいブロックであって前記画像データ上におけるこのブロックに対応する領域の図柄が前記画像データ上における前記探索基準ブロックに対応する領域の図柄と最も相似している相似ブロックを探索する第3のステップと、
前記各探索基準ブロックに対応する領域のシェイプデータをそれぞれの相似ブロックに対応する領域のシェイプデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップとを有し、
前記第1のステップでは、
前記画像データ中の各画素における前記対象物体の存在する確かさを表すラベルデータも受け、
前記第3のステップでは、
前記ラベルデータを参照して、対象物体が存在する可能性が低い画素同士の誤差を無視若しくは軽視してブロック全体の誤差の加重和を計算し、前記加重和が最小となる相似ブロックの探索を行う、
物体画像抽出方法。
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the shape data;
For each of the search reference blocks, the design of the area that is larger than the search reference block and that corresponds to this block on the image data is most similar to the design of the area that corresponds to the search reference block on the image data. A third step of searching for similar blocks,
A process of replacing the shape data of the area corresponding to each search reference block with a reduced version of the shape data of the area corresponding to each similar block, and repeatedly performing a process until a predetermined condition is satisfied,
In the first step,
Also receives label data representing the certainty of the target object at each pixel in the image data,
In the third step,
Referring to the label data, ignore or neglect the error between pixels that are unlikely to contain the target object, calculate the weighted sum of errors of the entire block, and search for similar blocks that minimize the weighted sum Do,
Object image extraction method.
前記シェイプデータが、
対象物体の概略形状の領域を表し、その各画素が前記画像データの各画素と1対1に対応させたものであり、
前記ラベルデータが、
前記画像データを対象物体確定領域、非対象物体確定領域、未定領域の3種類のうち少なくとも2種類の領域に区分し、その各画素が前記画像データの各画素と1対1に対応させたものであるとし、
前記第3のステップでは、
前記相似ブロックの候補である複数の候補ブロックそれぞれについて、
前記画像データにおける前記探索基準ブロックに対応する領域のデータと、前記画像データにおける候補ブロックに対応する領域を縮小したデータとの各対応点の誤差を計算し、
その加重和を、前記対応点が両方共に前記ラベルデータによって対象物体確定領域に区分される領域に存在する場合、若しくは両方共に非対象物体確定領域に区分される領域に存在する場合には、当該対応点についての誤差を無視若しくは軽視して求め、
前記誤差の加重和が最小となる候補ブロックを前記相似ブロックとして決定する、
請求項1記載の物体画像抽出方法。
The shape data is
Represents a region of the approximate shape of the target object, each pixel corresponding to each pixel of the image data one-to-one,
The label data is
The image data is divided into at least two types of three types of target object determination region, non-target object determination region, and undetermined region, and each pixel has a one-to-one correspondence with each pixel of the image data And
In the third step,
For each of a plurality of candidate blocks that are candidates for the similar block,
Calculating the error of each corresponding point between the data of the region corresponding to the search reference block in the image data and the data obtained by reducing the region corresponding to the candidate block in the image data;
The weighted sum is calculated when the corresponding points are both present in a region that is classified as a target object determination region by the label data, or when both are present in a region that is classified as a non-target object determination region. Ignore or neglect errors about corresponding points,
Determining a candidate block having the smallest weighted sum of errors as the similar block;
The object image extraction method according to claim 1.
前記第3のステップでは、
前記相似ブロックの候補である複数の候補ブロックそれぞれについて、
前記画像データにおける前記探索基準ブロックに対応する領域のデータと、前記画像データにおける候補ブロックに対応する領域を縮小したデータとの各対応点の誤差を計算し、
その加重和を、前記対応点が両方共に前記ラベルデータによって対象物体確定領域に区分される領域に存在する場合、若しくは、両方共に非対象物体確定領域に区分される領域に存在する場合には、当該対応点についての誤差に乗じる重み係数を0または小さな値にして求め、
前記誤差の加重和が最小となる候補ブロックを前記相似ブロックとして決定する、
請求項2記載の物体画像抽出方法。
In the third step,
For each of a plurality of candidate blocks that are candidates for the similar block,
Calculating the error of each corresponding point between the data of the region corresponding to the search reference block in the image data and the data obtained by reducing the region corresponding to the candidate block in the image data;
In the case where both of the corresponding points are present in the region classified into the target object fixed region by the label data, or both are present in the region classified into the non-target object fixed region, Obtain a weighting factor by which the error for the corresponding point is multiplied by 0 or a small value,
Determining a candidate block having the smallest weighted sum of errors as the similar block;
The object image extraction method according to claim 2.
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定し、これらのうち、前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが、前記対象物体の細い部分のパターンであるものは設定を解除する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、
前記シェイプデータにおいて前記各探索基準ブロックに対応する領域のデータをそれぞれの相似ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、
を有し、
前記第2のステップでは、前記シェイプデータ上における探索基準ブロックに対応する領域の周を走査して画素値の変化の回数を求め、変化の回数が2回を超える場合には前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが前記対象物体の細い部分のパターンであると判定する、
物体画像抽出方法。
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A plurality of search reference blocks are set to be shifted from each other along the outline of the schematic shape represented by the shape data, and among these, the pattern of the region corresponding to the search reference block on the shape data is A pattern of a thin portion of the target object is a second step of canceling the setting;
For each of the search reference blocks, a search is made for a similar block that is larger than the search reference block and whose symbol in the region corresponding to that block on the image data is most similar to the symbol in the region corresponding to the search reference block. And the steps
A fourth step of repeatedly performing the process of replacing the data of the area corresponding to each search reference block with the reduced data of the area corresponding to each similar block in the shape data until a predetermined condition is satisfied;
Have
In the second step, the number of changes in the pixel value is obtained by scanning the periphery of the region corresponding to the search reference block on the shape data, and when the number of changes exceeds two, Determining that the pattern of the region corresponding to the search reference block is a pattern of a thin portion of the target object;
Object image extraction method.
前記第2のステップでは、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定し、
各探索基準ブロックと中心位置を同じくする検査ブロックについて、前記シェイプデータ上における検査ブロックに対応する領域のパターンを調べ、
検査ブロックのパターンが、前記細い部分のパターンであるものについては探索基準ブロックの設定を解除する、
請求項記載の物体画像抽出方法。
In the second step,
A plurality of search reference blocks are set by shifting their positions along the outline of the schematic shape represented by the shape data,
For the inspection block having the same center position as each search reference block, examine the pattern of the area corresponding to the inspection block on the shape data,
Cancel the setting of the search reference block when the pattern of the inspection block is the pattern of the thin part,
The object image extraction method according to claim 4 .
前記第2のステップでは、前記シェイプデータ上で前記検査ブロックに対応する領域の周を走査することにより画素値の変化の回数を求め、変化の回数が2回を超える場合には、検査ブロックのパターンが前記対象物体の細い部分のパターンであると判定する、
請求項記載の物体画像抽出方法。
In the second step, the number of changes in the pixel value is obtained by scanning the periphery of the region corresponding to the inspection block on the shape data. If the number of changes exceeds two, Determining that the pattern is a pattern of a thin portion of the target object;
The object image extraction method according to claim 5 .
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索するとともに、前記シェイプデータ上の対応する領域のパターンが前記対象物体の細い部分のパターンである相似ブロックとこれに対応する探索基準ブロックの設定を解除する第3のステップと、
前記シェイプデータにおいて前記各探索基準ブロックに対応する領域のデータをそれぞれの相似ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、
を有し、
前記第3のステップでは、前記相似ブロックに対応する前記シェイプデータ上の領域の周をそれぞれ走査して画素値の変化の回数を求め、変化の回数が2回を超える場合には前記相似ブロックに対応する前記シェイプデータ上の領域のパターンが前記対象物体の細い部分のパターンであると判定する、
物体画像抽出方法。
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the shape data;
For each search reference block, search for a similar block that is larger than the search reference block and whose pattern on the image data corresponds most to the pattern of the area corresponding to the search reference block, and A third step of canceling the setting of a similar block in which a pattern of a corresponding region on the shape data is a pattern of a thin portion of the target object and a search reference block corresponding thereto;
A fourth step of repeatedly performing the process of replacing the data of the area corresponding to each search reference block with the reduced data of the area corresponding to each similar block in the shape data until a predetermined condition is satisfied;
Have
In the third step, the circumference of the area on the shape data corresponding to the similar block is scanned to determine the number of pixel value changes, and if the number of changes exceeds two, the similarity block Determining that the corresponding pattern of the region on the shape data is a pattern of a thin portion of the target object;
Object image extraction method.
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより小さくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、
前記シェイプデータにおいて前記各相似ブロックに対応する領域のデータをそれぞれの探索基準ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、
を有する物体画像抽出方法。
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the shape data;
For each search reference block, a search is made for a similar block that is smaller than the search reference block and whose pattern in the image data corresponding to the block is most similar to the pattern in the area corresponding to the search reference block. And the steps
A fourth step of repeatedly performing the process of replacing the data of the area corresponding to each similar block in the shape data with the reduced data of the area corresponding to each search reference block until a predetermined condition is satisfied;
An object image extraction method comprising:
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受け、これらを拡大して拡大画像データと拡大シェイプデータとを生成する第1のステップと、
前記拡大シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記拡大画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、
前記拡大シェイプデータにおいて前記各相似ブロックに対応する領域のデータをそれぞれの探索基準ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、
第4のステップで得られた拡大シェイプデータを元の大きさに縮小する第5のステップと、
を有する物体画像抽出方法。
First image data including image data including a target object to be extracted and shape data representing a region of a schematic shape of the target object in the image data are generated to generate enlarged image data and enlarged shape data. Steps,
A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the enlarged shape data;
For each search reference block, a search is made for a similar block that is larger than the search reference block and whose symbol on the enlarged image data is most similar to the symbol of the region corresponding to the search reference block. 3 steps,
A fourth step of repeatedly performing the process of replacing the data of the area corresponding to each similar block with the reduced data of the area corresponding to each search reference block in the enlarged shape data until a predetermined condition is satisfied;
A fifth step of reducing the enlarged shape data obtained in the fourth step to the original size;
An object image extraction method comprising:
コンピュータに、
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きいブロックであって前記画像データ上におけるこのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似している相似ブロックを探索する第3のステップと、
前記各探索基準ブロックに対応する領域のシェイプデータをそれぞれの相似ブロックに対応する領域のシェイプデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップとを実行させ、
前記第1のステップでは、
前記画像データ中の各画素における前記対象物体の存在する確かさを表すラベルデータも受け、
前記第3のステップでは、
前記ラベルデータを参照して、対象物体が存在する可能性が低い画素同士の誤差を無視若しくは軽視してブロック全体の誤差の加重和を計算し、前記加重和が最小となる相似ブロックの探索を行う、
物体画像抽出プログラム。
On the computer,
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the shape data;
For each of the search reference blocks, a block that is larger than the search reference block and whose pattern in the region corresponding to the block on the image data is most similar to the pattern in the region corresponding to the search reference block A third step of searching;
A step of repeatedly performing the process of replacing the shape data of the area corresponding to each search reference block with the reduced shape data of the area corresponding to each similar block until a predetermined condition is satisfied, and
In the first step,
Also receives label data representing the certainty of the target object at each pixel in the image data,
In the third step,
Referring to the label data, ignore or neglect the error between pixels that are unlikely to contain the target object, calculate the weighted sum of errors of the entire block, and search for similar blocks that minimize the weighted sum Do,
Object image extraction program.
前記シェイプデータが、
対象物体の概略形状を表し、その各画素が前記画像データの各画素と1対1に対応させたものであり、
前記ラベルデータが、
前記画像データを対象物体確定領域、非対象物体確定領域、未定領域の3種類のうち少なくとも2種類の領域に区分し、その各画素が前記画像データの各画素と1対1に対応させたものとし、
前記第3のステップでは、
前記相似ブロックの候補である複数の候補ブロックそれぞれについて、
前記画像データにおける前記探索基準ブロックに対応する領域のデータと、前記画像データにおける候補ブロックに対応する領域を縮小したデータとの各対応点の誤差を計算し、
その加重和を、前記対応点が両方共に前記ラベルデータによって対象物体確定領域に区分される領域に存在する場合、若しくは両方共に非対象物体確定領域に区分される領域に存在する場合に、当該対応点についての誤差を無視または軽視して求め、
前記誤差の加重和が最小となる候補ブロックを前記相似ブロックとして決定する、
請求項10記載の物体画像抽出プログラム。
The shape data is
Represents the schematic shape of the target object, each pixel of which is one-to-one correspondence with each pixel of the image data,
The label data is
The image data is divided into at least two types of three types of target object determination region, non-target object determination region, and undetermined region, and each pixel has a one-to-one correspondence with each pixel of the image data age,
In the third step,
For each of a plurality of candidate blocks that are candidates for the similar block,
Calculating the error of each corresponding point between the data of the region corresponding to the search reference block in the image data and the data obtained by reducing the region corresponding to the candidate block in the image data;
If the corresponding points are both present in a region that is classified as a target object defined region by the label data, or both are present in a region that is classified as a non-target object defined region Ignore or neglect errors about points,
Determining a candidate block having the smallest weighted sum of errors as the similar block;
The object image extraction program according to claim 10 .
コンピュータに、
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定し、これらのうち、前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが、前記対象物体の細い部分のパターンであるものは設定を解除する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索する第3のステップと、
前記シェイプデータにおいて前記各探索基準ブロックに対応する領域のデータをそれぞれの相似ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、
を実行し、
前記第2のステップでは、前記シェイプデータ上における探索基準ブロックに対応する領域の周を走査して画素値の変化の回数を求め、変化の回数が2回を超える場合には前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが前記対象物体の細い部分のパターンであると判定する、
物体画像抽出プログラム。
On the computer,
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A plurality of search reference blocks are set to be shifted from each other along the outline of the schematic shape represented by the shape data, and among these, the pattern of the region corresponding to the search reference block on the shape data is A pattern of a thin portion of the target object is a second step of canceling the setting;
For each of the search reference blocks, a search is made for a similar block that is larger than the search reference block and whose symbol in the region corresponding to that block on the image data is most similar to the symbol in the region corresponding to the search reference block. And the steps
A fourth step of repeatedly performing the process of replacing the data of the area corresponding to each search reference block with the reduced data of the area corresponding to each similar block in the shape data until a predetermined condition is satisfied;
The execution,
In the second step, the number of changes in the pixel value is obtained by scanning the periphery of the region corresponding to the search reference block on the shape data, and when the number of changes exceeds two, Determining that the pattern of the region corresponding to the search reference block is a pattern of a thin portion of the target object;
Object image extraction program.
前記第2のステップでは、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定し、
各探索基準ブロックと中心位置を同じくする検査ブロックについて、前記シェイプデータ上における検査ブロックに対応する領域のパターンを調べ、
検査ブロックのパターンが、前記細い部分のパターンであるものについては探索基準ブロックの設定を解除する、
請求項12記載の物体画像抽出プログラム。
In the second step,
A plurality of search reference blocks are set by shifting their positions along the outline of the schematic shape represented by the shape data,
For the inspection block having the same center position as each search reference block, examine the pattern of the area corresponding to the inspection block on the shape data,
Cancel the setting of the search reference block when the pattern of the inspection block is the pattern of the thin part,
The object image extraction program according to claim 12 .
コンピュータに、
抽出すべき対象物体を含む画像データと、前記画像データ中の対象物体の概略形状の領域を表すシェイプデータとを受ける第1のステップと、
前記シェイプデータによって表される概略形状の輪郭に沿って、複数の探索基準ブロックを互いの位置をずらして設定する第2のステップと、
前記探索基準ブロック毎に、前記探索基準ブロックより大きくて、前記画像データ上におけるそのブロックに対応する領域の図柄が前記探索基準ブロックに対応する領域の図柄と最も相似した相似ブロックを探索するとともに、前記シェイプデータ上の対応する領域のパターンが前記対象物体の細い部分のパターンである相似ブロックとこれに対応する探索基準ブロックの設定を解除する第3のステップと、
前記シェイプデータにおいて前記各探索基準ブロックに対応する領域のデータをそれぞれの相似ブロックに対応する領域のデータを縮小したもので置き換える処理を、所定の条件を満たすまで繰り返し行う第4のステップと、
を実行し、
前記第2のステップでは、前記シェイプデータ上における探索基準ブロックに対応する領域の周を走査して画素値の変化の回数を求め、変化の回数が2回を超える場合には前記シェイプデータ上における探索基準ブロックに対応する領域のパターンが前記対象物体の細い部分のパターンであると判定する、
物体画像抽出プログラム。
On the computer,
A first step of receiving image data including a target object to be extracted, and shape data representing a region of a schematic shape of the target object in the image data;
A second step of setting a plurality of search reference blocks by shifting their positions along the outline of the schematic shape represented by the shape data;
For each search reference block, search for a similar block that is larger than the search reference block and whose pattern on the image data corresponds most to the pattern of the area corresponding to the search reference block, and A third step of canceling the setting of a similar block in which a pattern of a corresponding region on the shape data is a pattern of a thin portion of the target object and a search reference block corresponding thereto;
A fourth step of repeatedly performing the process of replacing the data of the area corresponding to each search reference block with the reduced data of the area corresponding to each similar block in the shape data until a predetermined condition is satisfied;
The execution,
In the second step, the number of changes in the pixel value is obtained by scanning the periphery of the region corresponding to the search reference block on the shape data, and when the number of changes exceeds two, Determining that the pattern of the region corresponding to the search reference block is a pattern of a thin portion of the target object;
Object image extraction program.
JP2002250058A 2002-08-29 2002-08-29 Object image extraction method, object image extraction program Expired - Fee Related JP4150554B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002250058A JP4150554B2 (en) 2002-08-29 2002-08-29 Object image extraction method, object image extraction program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002250058A JP4150554B2 (en) 2002-08-29 2002-08-29 Object image extraction method, object image extraction program

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2008140592A Division JP2008243226A (en) 2008-05-29 2008-05-29 Object image extraction method

Publications (2)

Publication Number Publication Date
JP2004086793A JP2004086793A (en) 2004-03-18
JP4150554B2 true JP4150554B2 (en) 2008-09-17

Family

ID=32056982

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002250058A Expired - Fee Related JP4150554B2 (en) 2002-08-29 2002-08-29 Object image extraction method, object image extraction program

Country Status (1)

Country Link
JP (1) JP4150554B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220383034A1 (en) * 2021-05-27 2022-12-01 Microsoft Technology Licensing, Llc Image Processing for Stream of Input Images

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102007043433B3 (en) * 2007-03-24 2008-10-09 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. Apparatus and method for adapting a mask image
CN113642611B (en) * 2021-07-16 2024-04-12 重庆邮电大学 Fetal heart ultrasonic image identification method based on multiple granularities

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220383034A1 (en) * 2021-05-27 2022-12-01 Microsoft Technology Licensing, Llc Image Processing for Stream of Input Images
US11714881B2 (en) * 2021-05-27 2023-08-01 Microsoft Technology Licensing, Llc Image processing for stream of input images with enforced identity penalty

Also Published As

Publication number Publication date
JP2004086793A (en) 2004-03-18

Similar Documents

Publication Publication Date Title
JP4806230B2 (en) Deterioration dictionary generation program, method and apparatus
Wenyin et al. From raster to vectors: extracting visual information from line drawings
JP3950777B2 (en) Image processing method, image processing apparatus, and image processing program
JP2984633B2 (en) Reference image creation method and pattern inspection device
JP5854802B2 (en) Image processing apparatus, image processing method, and computer program
US20080232715A1 (en) Image processing apparatus
JP2001175857A (en) Reference image generating method, pattern inspecting device, and recording medium with recorded reference image generating program
JP2001109895A (en) Processing method for digital images
JP2002135592A (en) Image processing apparatus and recording medium
JP4125273B2 (en) Image processing apparatus and method, and program
JP2001043376A (en) Image extraction method and device and storage medium
CN104463873B (en) A kind of image object method for relocating scaled based on local uniform
JP2001101426A (en) Digital image processing method
JP2761467B2 (en) Image segmentation device and character recognition device
US11410300B2 (en) Defect inspection device, defect inspection method, and storage medium
JP2009049562A (en) Image processing device, method, and program
EP2782065A1 (en) Image-processing device removing encircling lines for identifying sub-regions of image
JP5600524B2 (en) Image processing apparatus, image processing method, program, and storage medium
JP2008243226A (en) Object image extraction method
US20220270232A1 (en) Apparatus for adjusting parameter related to defect detection for image processing for image processing, method for information processing, and program
JP4150554B2 (en) Object image extraction method, object image extraction program
JP3749726B1 (en) Low contrast defect inspection method under periodic noise, low contrast defect inspection method under repeated pattern
JP2003216959A (en) Method, device and program for extracting outline
JP4756436B2 (en) Pattern recognition apparatus, pattern recognition method, and pattern recognition program
US20110064314A1 (en) Line segment extraction device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050207

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20050415

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20050606

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071026

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071102

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071220

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20071220

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080401

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080529

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20080609

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20080630

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

Free format text: PAYMENT UNTIL: 20110704

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110704

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees