JP3706413B2 - Image composition method - Google Patents

Image composition method Download PDF

Info

Publication number
JP3706413B2
JP3706413B2 JP21237595A JP21237595A JP3706413B2 JP 3706413 B2 JP3706413 B2 JP 3706413B2 JP 21237595 A JP21237595 A JP 21237595A JP 21237595 A JP21237595 A JP 21237595A JP 3706413 B2 JP3706413 B2 JP 3706413B2
Authority
JP
Japan
Prior art keywords
image
background
pixel
digital
pixel value
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
JP21237595A
Other languages
Japanese (ja)
Other versions
JPH0944642A (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.)
Sanyo Electric Co Ltd
Original Assignee
Sanyo Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sanyo Electric Co Ltd filed Critical Sanyo Electric Co Ltd
Priority to JP21237595A priority Critical patent/JP3706413B2/en
Publication of JPH0944642A publication Critical patent/JPH0944642A/en
Application granted granted Critical
Publication of JP3706413B2 publication Critical patent/JP3706413B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、電子カタログの作成等に於いて、単色の背景にて撮影された物体の画像を対象として、該画像の背景部分を新しい背景画と置き換えるための画像合成方法に関するものである。
【0002】
【従来の技術】
近年、多数の商品のカタログを電子化して、商品の検索を高効率化し、更には商品の発注をオンライン化せんとする試みが為されている(特開平7-56784〔G06F12/00〕、特開平4-247567〔G06F15/21〕)。
この様な電子カタログの作成に於いては、先ず、商品を単色の背景にてカメラで撮影し、これによって得られたカラー画像をイメージスキャナー等によって取り込み、デジタル化する。デジタル化された原画像は、マイクロコンピュータによる画像処理回路に送られる。
【0003】
デジタル原画像は、例えば図10(a)の如く単色の背景部分Uと、商品の画像である物体部分Vから構成され、画像処理回路による画像合成処理によって、単色の背景部分Vが、図10(b)の如く新しい任意の背景画像U″と置き換えられる。
従って、新しく合成すべき背景画像U″を商品の種類に応じて自然の風景画像や人工的な模様画像に変更することにより、商品に対して種々の審美的効果を与えることが出来る。
【0004】
画像合成に際しては、先ず、図10(a)のデジタル原画像を対象として、明らかに背景部分と推定される画素を選出し、その後、選出画素と隣接し、且つ画素値に大きな差のない次の画素、即ち所定のしきい値を上回らない隣接画素を順次選び出していく。ここで、画素値としては、例えばRGBの3原色信号(“0”〜“255”)にYIQ変換を施して得られる輝度データを採用することが出来る。
この結果、デジタル画像は、前記しきい値に基づいて、図11(a)の如く物体領域と背景領域に分離される。
そこで、図11(b)の如く背景領域の画素値を、新しい背景画像の画素値に置き換えることにより、合成画像を得るのである。
尚、図11(a)(b)は、画素位置の1次元方向の変化による画素値の変化を模式的に表わしたものである。
【0005】
【発明が解決しようとする課題】
しかしながら、デジタル原画像は、イメージスキャナー等によるデジタル化の際の量子化誤差によって、図11(a)に示す様に背景領域と物体領域の境界が鈍化し、背景領域から物体領域に跨る数画素の領域内で画素値が連続的に変化することになる。
この結果、図11(b)の如く背景領域を新しい背景画像で置き換えた場合、合成画像の画素値の変化は、新しい背景画像と物体画像の間で不連続となり、物体画像の内、量子化誤差によって鈍化されたリング状の領域Rには、元の背景色との混合色が残って、図10(b)の如く物体の周囲が混合色で縁取られた不自然な合成画像となる問題があった。
【0006】
前記縁取りの問題は、しきい値を高く設定することによって、ある程度は軽減可能である。ところが、物体領域の画素値は場所によって大きく異なり、しきい値は、物体領域の画素の内、最も背景領域に近い画素の画素値よりも更に低く設定する必要があるので、事実上、しきい値を十分に高く設定することが出来ず、前記縁取りの問題を解消することは困難である。
本発明の目的は、デジタル原画像の背景部分を任意のデジタル背景画像と置き換える画像合成処理に於いて、物体の画像と背景の画像の間に不自然な境界領域が生成されることのない画像合成方法を提供することである。
【0007】
【課題を解決するための手段】
本発明に係る画像合成方法は、デジタル原画像を所定のしきい値によって背景領域と物体領域に分離する第1ステップと、前記背景領域と物体領域の間に境界部分を設定し、デジタル原画像を背景部分、物体部分及び境界部分の3つの領域に分割する第2ステップと、前記背景部分についてはデジタル背景画像と置き換え、物体部分については原画像を維持し、境界部分については、物体部分の原画像からデジタル背景画像まで画素値を滑らかに変化させる接続画像を生成し、これら3つの画像を合成する第ステップとを有している。
具体的には、第3ステップにて、デジタル原画像の境界部分を構成する各画素について、該画素の画素値が、該画素から最も近い物体部分の画素の画素値と、デジタル原画像の背景部分の画素値との混合値であるとしたときの混合率を算出した後、接続画像を構成すべき各画素については、該画素から最も近い物体部分の画素値と、デジタル背景画像の中で該画素に最も近い部分の画素値とを、同一画素位置の混合率で混合して、該画素の画素値を算出する。
【0008】
上記画像合成方法に於いては、第1ステップにて設定されるべきしきい値は、デジタル原画像の背景部分の画素値と物体部分の画素値の間の任意値であればよく、従来の様に微妙な値の設定は不要である。第2ステップにて設定される境界部分は、前記しきい値の大小に拘わらず、デジタル原画像に於いて量子化誤差により生じていた物体画像と背景画像の間の鈍化部分を包含する幅領域に設定される。第3ステップでは、前記鈍化部分に替えて、物体部分の原画像からデジタル背景画像まで画素値を滑らかに変化させる接続画像が新たに生成される。従って、背景部分のデジタル背景画像と、物体部分の原画像と、境界部分の接続画像とを1画面に合成することによって、物体部分から背景部分まで画素値が滑らかに変化する合成画像が得られる。
又、上記画像合成方法に於いては、接続画像を構成すべき各画素について適切な画素値が設定される。
即ち、デジタル原画像の境界部分に於いては、画素値が連続的に変化していることから、各画素の画素値は、該画素から最も近い物体部分の画素値と背景部分の画素値とを、その画素位置に応じた比率で混合した値であると考えることが出来るので、該混合率を算出した後、画像合成の際にも、同一の画素位置については、同一の混合率で物体部分の画素値とデジタル背景画像の画素値を混合することによって、接続画像を構成する各画素の画素値を妥当な値として算出することが出来るのである。
【0009】
又、具体的には、第2ステップにて、デジタル原画像を、背景領域の第1画素値(例えば“255”)と物体領域の第2画素値(例えば“0”)に2値化した後、該2値画像に平滑化処理を施し、背景領域と物体領域の間の鈍化された領域を境界部分とし、残りの領域を背景部分及び物体部分とする。該具体的方法によれば、背景部分と物体部分の間に、平滑化処理の単位領域の広さに応じた幅(数画素程度)の境界部分が形成されることになる。
【0012】
【発明の効果】
本発明に係る画像合成方法によれば、物体部分の原画像と背景部分のデジタル背景画像とが、境界部分の接続画像によって、滑らかな画素値の変化で接続されるので、物体の画像と背景の画像の間に不自然な境界領域が生成されることはなく、自然な合成画像が得られる。
【0013】
【発明の実施の形態】
以下、本発明の実施の形態につき、図面に沿って具体的に説明する。
図1は本発明の画像合成の手順を表わし、図2(a)〜(d)は、該手順によってデジタル原画像から合成画像が作成される過程を図示したものである。
【0014】
図2(a)の如く単色の背景部分Uと商品の画像である物体部分Vから構成されるフルカラーのデジタル原画像を対象として、該背景部分に新しい任意の背景画像U′を重ね合わせる場合、以下の画像合成処理が実行される。
尚、デジタル原画像及び、合成すべき新しい背景画像のデジタル背景画像は、各画素がRGBの3原色信号(“0”〜“255”)によって構成され、後述のしきい値による画像分離等に用いられる「画素値」としては、例えば3原色信号にYIQ変換を施して得られる輝度データYが採用される。
【0015】
先ず、図1のステップS1にて、デジタル原画像を背景領域と物体領域に分離する際の基準となるしきい値を設定する。ここで、しきい値は図3に示す如く、デジタル原画像の背景部分の画素値と物体部分の画素値との間の任意値として設定すればよい。
そして、図1のステップS2では、前記しきい値よりも低い画素値の画素を背景部分、前記しきい値よりも高い画素値の画素を物体部分として、デジタル原画像を背景部分と物体部分に分離する。
【0016】
しきい値による画像分離の具体的手続きは、先ず、明らかに背景部分と推定される画素を選出し、その後、選出した画素と隣接し、且つ画素値に大きな差のない次の画素、即ち所定のしきい値を上回らない隣接画素を順次選び出していく。この結果、デジタル原画像から背景部分が分離されることになり、残りの領域が物体部分となる(図3参照)。
尚、物体画像の中央部に中空領域が存在し、該中空領域も新しい背景画像に置き換えんとする場合は、該中空領域についても背景部分として選出し、分離する必要がある。
【0017】
次に、図1のステップS3にて、前記分離された背景部分を“255”、物体部分を“0”として、デジタル原画像を2値化する。この結果、図2(b)の如き2値画像が得られる。
続いてステップS4にて、前記2値画像に対し、例えば半径4画素のGaussianフィルターによる平滑化処理を施して、背景部分と物体部分の境界を鈍化し、図4に示す如く背景部分と物体部分の間に、両者の混じり合った境界部分を形成する。
ここで、境界部分は、図4に破線で示すデジタル原画像の物体と背景の間の鈍化部分を完全に包含する幅領域(数画素程度)に設定されることになる。
【0018】
そして、デジタル原画像の全領域を、図2(c)に示す如く前記境界部分W3、その両側の背景部分W1及び物体部分W2の3つ領域に3分割し、図1のステップS5では、背景部分W1の画素値を“255”、物体部分W2の画素値を“0”、境界部分W3の画素値をその中間値、例えば“128”に設定して、デジタル原画像を3値化する。
【0019】
その後、3値化された3つの画像領域(背景部分W1、物体部分W2及び境界部分W3)を対象として、夫々下記の処理を実行する。
背景部分W1については、図1のステップS6にて、図2(a)に示す元のデジタル原画像(3原色信号)を新しいデジタル背景画像(3原色信号)と置き換える。物体部分W2については、図1のステップS9にて、図2(a)に示す元のデジタル原画像(3原色信号)をそのまま維持する。
境界部分W3については、ステップS7及びS8にて、図9に示す様に物体部分の画像から新しい背景の画像まで、画素値、即ち3原色信号(R、G、B)を滑らかに変化させるための接続画像を生成する。
【0020】
ここで、前記ステップS7及びS8による接続画像の生成方法について、具体的に説明する。尚、ステップS7及びS8の処理は、3原色信号(R、G、B)の夫々について実行される。
図7の如くデジタル原画像は、物体部分から背景部分へ至る境界部分の画素値が連続的に変化しているので、境界部分のある1点Pの画素値は、該画素から最も近い物体部分の画素値と背景部分の画素値とを、その画素位置に応じた比率で混合した値であると考えることが出来る。
【0021】
即ち、物体部分の画素値をO、背景部分の画素値をB、前記1点の画素値をPで表わしたとき、混合比率Xは下記数1で表わされる。
【数1】
X=(P−B)/(O−B)
【0022】
同様に、図8に示す如く物体画像と新しい背景画像とを滑らかに繋ぐ接続画像に於いても、接続画像の画素値を連続的に変化させるには、ある1点P′の画素値は、該画素から最も近い物体部分の画素値と、該画素から最も近い新しい背景部分の画素値とを、その画素位置に応じた比率で混合した値に設定すればよい。
【0023】
即ち、新しい背景部分の画素値をN、前記1点の画素値をP′で表わしたとき、混合比率X′は下記数2で表わされる。
【数2】
X′=(P′−N)/(O−N)
【0024】
上記数1の混合比率Xと上記数2の混合比率X′は同一値に設定するのが妥当であるので、これらの関係から下記数3が得られる。
【数3】
P′={N(O−P)+O(P−B)}/(O−B)
【0025】
従って、上記数3によって境界画像の全ての画素について新しい画素値を算出することが出来る。
但し、物体部分の画素値Oは、画素値算出の対象とする画素から最も近い物体部分の画素値であるが、該画素値は、対象画素の位置によって異なるので、全ての対象画素について別個に算出する必要がある。
【0026】
そこで、図5の如く境界部分W3を所定の微小領域(例えば数画素程度)に分割し、各微小領域の3値画像(画素値“128”)の画素分布に対し、最小二乗法を適用して、該画素分布を直線Lで近似した後、該直線Lに対して垂線Mを引く。そして、該垂線Mが物体部分W2との境界線を交差する点を求め、該交差点におけるデジタル原画像の画素値を、前記物体部分の真の画素値Oと推定するのである(図1のステップS7)。
これによって、図6(a)の如く物体部分W2と境界部分W3の境界線が水平の場合は、垂直の垂線Mが引かれて、P点から最も近いO点が求められる。図6(b)の如く境界線が垂直の場合は、水平の垂線Mが引かれて、P点から最も近いO点が求められる。又、図6(c)の如く境界線が傾斜している場合は、傾斜した垂線Mが引かれて、P点から最も近いO点が求められることになる。
【0027】
この様にして、物体部分の真の画素値Oを推定した後、前記数3によって境界画像の各画素値P′を算出するのである(図1のステップS8)。この演算処理を境界部分の全ての画素を対象として実行することにより、境界画像が生成されることになる。
最後にステップS10にて、ステップS6により求めた背景部分の画像と、ステップS7及びS8により求めた境界画像と、ステップS9により求めた物体部分の画像とを、3原色信号R、G、Bの夫々について合成し、最終的に、図2(d)の如く新しいデジタル背景画像U′と物体部分の原画像U′からなるフルカラーのデジタル合成画像を得る。
【0028】
該合成画像に於いては、図9の如く物体部分の原画像と背景部分のデジタル背景画像とが接続画像によって滑らかに接続され、該接続画像は、物体画像と新しい背景画像とが適切な比率で混合されたものであるから、両画像の境界が視覚的に違和感のない境界線として認識される。
又、図1に示す手続きによれば、簡易な演算処理によって画像合成を行なうことが出来るので、迅速な合成処理が可能であり、ハードウエア化も容易である。
【0029】
上記実施の形態の説明は、本発明を説明するためのものであって、特許請求の範囲に記載の発明を限定し、或は範囲を減縮する様に解すべきではない。又、本発明の各部構成は上記実施の形態に限らず、特許請求の範囲に記載の技術的範囲内で種々の変形が可能であることは勿論である。
【図面の簡単な説明】
【図1】本発明に係る画像合成方法の具体的手順を表わすフローチャートである。
【図2】該手順によって画像が合成される過程(a)〜(d)を表わす図である。
【図3】2値化による画像分離の説明図である。
【図4】平滑化処理及び3値化による画像分割の説明図である。
【図5】最小二乗法による真の画素値の推定方法の原理を説明する図である。
【図6】該推定方法によって真の画素値が推定される様子を3種類の画像パターン(a)(b)(c)について示す図である。
【図7】デジタル原画像における境界部分の画素値の混合比率を説明する図である。
【図8】合成画像における境界部分の画素値の混合比率を説明する図である。
【図9】合成画像における画素値の分布を示す図である。
【図10】デジタル原画像(a)と、従来の合成画像(b)を示す図である。
【図11】デジタル画像における画素値の分布(a)と、従来の合成画像における画素値の分布(b)を示す図である。
【符号の説明】
U デジタル原画像の背景部分
V デジタル原画像の物体部分
W1 3値化画像の背景部分
W2 3値化画像の物体部分
W3 3値化画像の境界部分
U′ 合成画像の背景部分
V′ 合成画像の物体部分
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to an image composition method for replacing an image of an object photographed with a monochromatic background with a new background image in the creation of an electronic catalog or the like.
[0002]
[Prior art]
In recent years, attempts have been made to digitize catalogs of a large number of products, increase the efficiency of product searches, and to make product orders online (Japanese Patent Application Laid-Open No. 7-56784 [G06F12 / 00]). Kaihei 4-247567 [G06F15 / 21]).
In creating such an electronic catalog, first, a product is photographed with a camera on a monochrome background, and a color image obtained thereby is captured by an image scanner or the like and digitized. The digitized original image is sent to an image processing circuit by a microcomputer.
[0003]
The digital original image is composed of, for example, a monochrome background portion U as shown in FIG. 10 (a) and an object portion V which is an image of a product. As shown in (b), it is replaced with a new arbitrary background image U ″.
Accordingly, by changing the background image U ″ to be newly synthesized into a natural landscape image or an artificial pattern image according to the type of product, various aesthetic effects can be given to the product.
[0004]
At the time of image composition, first, a pixel that is clearly estimated to be a background portion is selected for the digital original image of FIG. 10A, and then the next pixel that is adjacent to the selected pixel and has no significant difference in pixel value. Pixels, that is, adjacent pixels that do not exceed a predetermined threshold are sequentially selected. Here, as pixel values, for example, luminance data obtained by performing YIQ conversion on RGB three primary color signals ("0" to "255") can be employed.
As a result, the digital image is separated into an object area and a background area as shown in FIG. 11A based on the threshold value.
Therefore, the synthesized image is obtained by replacing the pixel value of the background area with the pixel value of the new background image as shown in FIG.
FIGS. 11A and 11B schematically show changes in pixel values due to changes in the one-dimensional direction of pixel positions.
[0005]
[Problems to be solved by the invention]
However, in the digital original image, the boundary between the background region and the object region is blunted as shown in FIG. 11A due to quantization error at the time of digitization by an image scanner or the like, and several pixels straddling the background region to the object region. The pixel value continuously changes within the region.
As a result, when the background region is replaced with a new background image as shown in FIG. 11B, the change in the pixel value of the composite image becomes discontinuous between the new background image and the object image, and the quantization of the object image In the ring-shaped region R blunted by the error, a mixed color with the original background color remains, resulting in an unnatural composite image in which the periphery of the object is bordered with the mixed color as shown in FIG. was there.
[0006]
The bordering problem can be alleviated to some extent by setting a high threshold value. However, the pixel value of the object region varies greatly depending on the location, and the threshold value has to be set lower than the pixel value of the pixel closest to the background region among the pixels of the object region. The value cannot be set sufficiently high, and it is difficult to eliminate the bordering problem.
An object of the present invention is an image in which an unnatural boundary region is not generated between an object image and a background image in an image composition process in which a background portion of a digital original image is replaced with an arbitrary digital background image. It is to provide a synthesis method.
[0007]
[Means for Solving the Problems]
The image composition method according to the present invention includes a first step of separating a digital original image into a background area and an object area by a predetermined threshold, and setting a boundary portion between the background area and the object area, Is divided into three regions, a background part, an object part, and a boundary part, the background part is replaced with a digital background image, the original part is maintained for the object part, and the object part is And a third step of generating a connection image in which pixel values are smoothly changed from the original image to the digital background image, and synthesizing these three images.
Specifically, in the third step, for each pixel constituting the boundary portion of the digital original image, the pixel value of the pixel is the pixel value of the object portion pixel closest to the pixel and the background of the digital original image After calculating the mixing ratio when it is a mixed value with the pixel value of the part, for each pixel that should constitute the connection image, the pixel value of the object part closest to the pixel and the digital background image The pixel value of the pixel closest to the pixel is mixed at the mixing ratio at the same pixel position to calculate the pixel value of the pixel.
[0008]
In the image composition method, the threshold value to be set in the first step may be an arbitrary value between the pixel value of the background portion and the pixel value of the object portion of the digital original image. It is not necessary to set a delicate value. The boundary portion set in the second step is a width region including a blunt portion between the object image and the background image that has been caused by the quantization error in the digital original image regardless of the threshold value. Set to In the third step, instead of the blunted part, a connection image is generated that smoothly changes the pixel value from the original image of the object part to the digital background image. Therefore, by synthesizing the digital background image of the background portion, the original image of the object portion, and the connection image of the boundary portion on one screen, a composite image in which pixel values smoothly change from the object portion to the background portion can be obtained. .
In the image composition method, an appropriate pixel value is set for each pixel that should form a connection image.
That is, since the pixel value continuously changes at the boundary portion of the digital original image, the pixel value of each pixel is the pixel value of the object portion closest to the pixel and the pixel value of the background portion. Can be considered as a value that is mixed at a ratio according to the pixel position. By mixing the pixel value of the portion and the pixel value of the digital background image, the pixel value of each pixel constituting the connection image can be calculated as an appropriate value.
[0009]
Further, specifically, in the second step, the raw digital image, and binarizes the first pixel value of the background area (for example, "255") and the second pixel value of the object area (for example, "0") Thereafter, the binary image is subjected to a smoothing process, and a blunt area between the background area and the object area is set as a boundary part, and the remaining areas are set as a background part and an object part. According to the specific method, a boundary portion having a width (about several pixels) corresponding to the width of the unit region for the smoothing process is formed between the background portion and the object portion.
[0012]
【The invention's effect】
According to the image composition method of the present invention, the original image of the object part and the digital background image of the background part are connected with a smooth change in pixel value by the connection image of the boundary part. An unnatural boundary region is not generated between the two images, and a natural composite image is obtained.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be specifically described with reference to the drawings.
FIG. 1 shows an image composition procedure according to the present invention, and FIGS. 2A to 2D illustrate a process in which a composite image is created from a digital original image by the procedure.
[0014]
When superimposing a new arbitrary background image U ′ on a background of a full-color digital original image composed of a single-color background portion U and an object portion V, which is a product image, as shown in FIG. The following image composition process is executed.
The digital background image and the digital background image of the new background image to be synthesized are each composed of RGB three primary color signals ("0" to "255"), and are used for image separation based on thresholds described later. As the “pixel value” used, for example, luminance data Y obtained by performing YIQ conversion on the three primary color signals is employed.
[0015]
First, in step S1 of FIG. 1, a threshold value is set as a reference for separating the digital original image into a background area and an object area. Here, as shown in FIG. 3, the threshold value may be set as an arbitrary value between the pixel value of the background portion of the digital original image and the pixel value of the object portion.
In step S2 of FIG. 1, a pixel having a pixel value lower than the threshold is set as a background portion, a pixel having a pixel value higher than the threshold is set as an object portion, and the digital original image is set as a background portion and an object portion. To separate.
[0016]
The specific procedure for image separation based on the threshold is as follows. First, a pixel that is clearly estimated to be a background portion is selected, and then the next pixel that is adjacent to the selected pixel and has no significant difference in pixel value, that is, a predetermined pixel. Neighboring pixels that do not exceed the threshold are sequentially selected. As a result, the background portion is separated from the digital original image, and the remaining region becomes the object portion (see FIG. 3).
When a hollow area exists in the center of the object image and the hollow area is also replaced with a new background image, it is necessary to select and separate the hollow area as a background portion.
[0017]
Next, in step S3 of FIG. 1, the digital original image is binarized by setting the separated background portion to “255” and the object portion to “0”. As a result, a binary image as shown in FIG. 2B is obtained.
In step S4, the binary image is smoothed by a Gaussian filter having a radius of 4 pixels, for example, so that the boundary between the background portion and the object portion is blunted. As shown in FIG. In between, the boundary part where both are mixed is formed.
Here, the boundary portion is set to a width region (about several pixels) that completely includes the blunt portion between the object and the background of the digital original image indicated by a broken line in FIG.
[0018]
Then, the entire area of the digital original image is divided into three areas, that is, the boundary portion W3, the background portion W1 on both sides thereof, and the object portion W2 as shown in FIG. 2C. In step S5 in FIG. The digital original image is ternarized by setting the pixel value of the portion W1 to “255”, the pixel value of the object portion W2 to “0”, and the pixel value of the boundary portion W3 to an intermediate value thereof, for example, “128”.
[0019]
Thereafter, the following processing is executed on three ternary image areas (background part W1, object part W2, and boundary part W3).
For the background portion W1, the original digital primary image (three primary color signals) shown in FIG. 2A is replaced with a new digital background image (three primary color signals) in step S6 of FIG. For the object portion W2, the original digital original image (three primary color signals) shown in FIG. 2A is maintained as it is in step S9 of FIG.
For the boundary portion W3, in steps S7 and S8, in order to smoothly change the pixel values, that is, the three primary color signals (R, G, B) from the object portion image to the new background image as shown in FIG. A connection image is generated.
[0020]
Here, the connection image generation method in steps S7 and S8 will be described in detail. The processes in steps S7 and S8 are executed for each of the three primary color signals (R, G, B).
Since the pixel value of the boundary portion from the object portion to the background portion continuously changes in the digital original image as shown in FIG. 7, the pixel value of one point P having the boundary portion is the object portion closest to the pixel. Can be considered as a value obtained by mixing the pixel value of the pixel and the pixel value of the background portion at a ratio corresponding to the pixel position.
[0021]
That is, when the pixel value of the object portion is represented by O, the pixel value of the background portion is represented by B, and the pixel value of the one point is represented by P, the mixing ratio X is represented by the following formula 1.
[Expression 1]
X = (P−B) / (O−B)
[0022]
Similarly, in the connection image that smoothly connects the object image and the new background image as shown in FIG. 8, in order to continuously change the pixel value of the connection image, the pixel value of one point P ′ is: The pixel value of the object part closest to the pixel and the pixel value of the new background part closest to the pixel may be set to a value that is mixed at a ratio according to the pixel position.
[0023]
That is, when the pixel value of the new background portion is represented by N and the pixel value of the one point is represented by P ′, the mixing ratio X ′ is represented by the following formula 2.
[Expression 2]
X '= (P'-N) / (ON)
[0024]
Since it is appropriate to set the mixing ratio X of the formula 1 and the mixing ratio X ′ of the formula 2 to the same value, the following formula 3 is obtained from these relationships.
[Equation 3]
P ′ = {N (OP) + O (P−B)} / (OB)
[0025]
Therefore, a new pixel value can be calculated for all the pixels of the boundary image by the above equation (3).
However, the pixel value O of the object portion is the pixel value of the object portion closest to the pixel for which the pixel value is to be calculated, but the pixel value differs depending on the position of the target pixel, so that it is separately determined for all target pixels. It is necessary to calculate.
[0026]
Therefore, as shown in FIG. 5, the boundary portion W3 is divided into predetermined minute areas (for example, about several pixels), and the least square method is applied to the pixel distribution of the ternary image (pixel value “128”) in each minute area. After approximating the pixel distribution with a straight line L, a perpendicular line M is drawn with respect to the straight line L. Then, a point where the perpendicular M intersects the boundary line with the object part W2 is obtained, and the pixel value of the digital original image at the intersection is estimated as the true pixel value O of the object part (step of FIG. 1). S7).
As a result, when the boundary line between the object part W2 and the boundary part W3 is horizontal as shown in FIG. 6A, a vertical perpendicular M is drawn, and the point O closest to the point P is obtained. When the boundary line is vertical as shown in FIG. 6B, a horizontal perpendicular line M is drawn, and the point O closest to the point P is obtained. When the boundary line is inclined as shown in FIG. 6C, the inclined perpendicular line M is drawn, and the point O closest to the point P is obtained.
[0027]
In this way, after estimating the true pixel value O of the object portion, each pixel value P ′ of the boundary image is calculated by the equation 3 (step S8 in FIG. 1). By executing this calculation process for all the pixels in the boundary portion, a boundary image is generated.
Finally, in step S10, the background image obtained in step S6, the boundary image obtained in steps S7 and S8, and the object image obtained in step S9 are converted into the three primary color signals R, G, and B. Each of these is synthesized, and finally a full-color digital synthesized image composed of a new digital background image U ′ and an original image U ′ of the object part is obtained as shown in FIG.
[0028]
In the composite image, the original image of the object portion and the digital background image of the background portion are smoothly connected by the connection image as shown in FIG. 9, and the connection image has an appropriate ratio between the object image and the new background image. Therefore, the boundary between the two images is recognized as a boundary line that does not cause a sense of incongruity.
Further, according to the procedure shown in FIG. 1, since image composition can be performed by simple arithmetic processing, rapid composition processing is possible and hardware implementation is also easy.
[0029]
The above description of the embodiment is for explaining the present invention, and should not be construed as limiting the invention described in the claims or reducing the scope thereof. The configuration of each part of the present invention is not limited to the above-described embodiment, and various modifications can be made within the technical scope described in the claims.
[Brief description of the drawings]
FIG. 1 is a flowchart showing a specific procedure of an image composition method according to the present invention.
FIG. 2 is a diagram illustrating processes (a) to (d) in which an image is synthesized by the procedure.
FIG. 3 is an explanatory diagram of image separation by binarization.
FIG. 4 is an explanatory diagram of image division by smoothing processing and ternarization.
FIG. 5 is a diagram for explaining the principle of a true pixel value estimation method by a least square method.
FIG. 6 is a diagram showing a state in which true pixel values are estimated by the estimation method for three types of image patterns (a), (b), and (c).
FIG. 7 is a diagram illustrating a mixing ratio of pixel values at a boundary portion in a digital original image.
FIG. 8 is a diagram illustrating a mixing ratio of pixel values at a boundary portion in a composite image.
FIG. 9 is a diagram illustrating a distribution of pixel values in a composite image.
FIG. 10 is a diagram showing a digital original image (a) and a conventional composite image (b).
FIG. 11 is a diagram illustrating a pixel value distribution (a) in a digital image and a pixel value distribution (b) in a conventional composite image.
[Explanation of symbols]
U background part of digital original image V object part of digital original image W1 background part of ternary image W2 object part of ternary image W3 boundary part of ternary image U ′ background part of composite image V ′ of composite image Object part

Claims (2)

単色の背景にて撮影された物体の画像をデジタル化してなるデジタル原画像と、該デジタル原画像の背景部分と置き換えられるべき任意のデジタル背景画像とを合成する方法であって、
デジタル原画像を所定のしきい値によって背景領域と物体領域に分離する第1ステップと、
前記背景領域と物体領域の間に、両領域に跨る境界部分を設定し、デジタル原画像を背景部分、物体部分及び境界部分の3つの領域に分割する第2ステップと、
前記背景部分についてはデジタル背景画像と置き換え、物体部分については原画像を維持し、境界部分については、物体部分の原画像からデジタル背景画像まで画素値を滑らかに変化させる接続画像を生成し、これら3つの画像を合成する第3ステップ
とを有し
第3ステップでは、デジタル原画像の境界部分を構成する各画素について、該画素の画素値が、該画素から最も近い物体部分の画素の画素値と、デジタル原画像の背景部分の画素値との混合値であるとしたときの混合率を算出した後、接続画像を構成すべき各画素については、該画素から最も近い物体部分の画素値と、デジタル背景画像の中で該画素から最も近い部分の画素値とを、同一画素位置の混合率で混合して、該画素の画素値を算出する画像合成方法。
A method of synthesizing a digital original image obtained by digitizing an image of an object photographed with a single color background and an arbitrary digital background image to be replaced with a background portion of the digital original image,
A first step of separating the digital original image into a background area and an object area by a predetermined threshold;
A second step of setting a boundary portion between both the background region and the object region, and dividing the digital original image into three regions of the background portion, the object portion, and the boundary portion;
The background portion is replaced with a digital background image, the object portion is maintained as the original image, and the boundary portion is generated as a connection image that smoothly changes pixel values from the object portion original image to the digital background image. A third step of combining the three images ,
In the third step, for each pixel constituting the boundary portion of the digital original image, the pixel value of the pixel is the pixel value of the object portion pixel closest to the pixel and the pixel value of the background portion of the digital original image. After calculating the mixing ratio when it is a mixed value, for each pixel that should form the connection image, the pixel value of the object part closest to the pixel and the part of the digital background image closest to the pixel An image composition method for calculating the pixel value of the pixel by mixing the pixel value of the pixel with the mixing ratio at the same pixel position.
第2ステップでは、デジタル原画像を背景領域の第1画素値と物体領域の第2画素値に2値化した後、該2値画像に平滑化処理を施し、背景領域と物体領域の間の鈍化された領域を境界部分とし、残りの領域を背景部分及び物体部分とする請求項1に記載の画像合成方法。In the second step, after the digital original image is binarized into the first pixel value of the background area and the second pixel value of the object area, the binary image is subjected to a smoothing process, and the digital image is processed between the background area and the object area. The image composition method according to claim 1, wherein the blunt area is a boundary part, and the remaining area is a background part and an object part.
JP21237595A 1995-07-27 1995-07-27 Image composition method Expired - Fee Related JP3706413B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP21237595A JP3706413B2 (en) 1995-07-27 1995-07-27 Image composition method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP21237595A JP3706413B2 (en) 1995-07-27 1995-07-27 Image composition method

Publications (2)

Publication Number Publication Date
JPH0944642A JPH0944642A (en) 1997-02-14
JP3706413B2 true JP3706413B2 (en) 2005-10-12

Family

ID=16621532

Family Applications (1)

Application Number Title Priority Date Filing Date
JP21237595A Expired - Fee Related JP3706413B2 (en) 1995-07-27 1995-07-27 Image composition method

Country Status (1)

Country Link
JP (1) JP3706413B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3480648B2 (en) * 1996-11-12 2003-12-22 ソニー株式会社 Video signal processing apparatus and video signal processing method
US8098950B2 (en) * 2003-11-26 2012-01-17 General Electric Company Method and apparatus for segmentation-based image operations

Also Published As

Publication number Publication date
JPH0944642A (en) 1997-02-14

Similar Documents

Publication Publication Date Title
JPH02162475A (en) Picture contour correcting method
JPH0750752A (en) Method and device for converting picture density
JPH05153493A (en) Video signal synthesis device
JP3706413B2 (en) Image composition method
JP2507578B2 (en) Color drawing workstation
JPH05236347A (en) Soft key generating device
JP3783815B2 (en) Image processing device
JPH06292014A (en) Picture processor
Inoue Object extraction method for image synthesis
JPS62204379A (en) Picture processor
JP4684074B2 (en) Image processing device
JP2005309870A (en) Image processor
JPH05204348A (en) Color image color changing processing system and color image synthesizing processing system
JPH01125681A (en) Filtering processing method for digital picture data
JPH0962250A (en) Image working device and method
JPH0122953B2 (en)
JPH01307384A (en) Motion detecting circuit
JPH08251397A (en) Method and device for image processing
JP4182981B2 (en) Image smoothing method and resolution conversion method
JPH0522666A (en) Binary picture signal contour extraction device
JPH08336115A (en) Frame interpolating method
JP2000020687A (en) Image processor and image processing method therefor
JP3179820B2 (en) Color hollow image processing method and apparatus
JPH04186967A (en) Color image processor
JPH0454263B2 (en)

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050405

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050603

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050729

LAPS Cancellation because of no payment of annual fees