JP2005303738A - Image processing apparatus - Google Patents
Image processing apparatus Download PDFInfo
- Publication number
- JP2005303738A JP2005303738A JP2004118231A JP2004118231A JP2005303738A JP 2005303738 A JP2005303738 A JP 2005303738A JP 2004118231 A JP2004118231 A JP 2004118231A JP 2004118231 A JP2004118231 A JP 2004118231A JP 2005303738 A JP2005303738 A JP 2005303738A
- Authority
- JP
- Japan
- Prior art keywords
- image
- frame
- background
- data
- shape data
- 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.)
- Pending
Links
Images
Abstract
Description
本発明は、画像処理技術に関し、特に動画像を符号化するための画像処理技術に関する。 The present invention relates to an image processing technique, and more particularly to an image processing technique for encoding a moving image.
近年、デジタル技術を利用して画像を対象物(オブジェクト)毎に分離、合成する処理が注目されている。特に、動画像の符号化においては、国際標準としてMPEG−4符号化方式が規格化されている。MPEG−4符号化方式では、任意形状の画像データが扱え、オブジェクト毎の符号化/復号化を行うことにより、符号化効率の向上、伝送路に応じたデータ配分、画像の再加工等、従来は困難であったさまざまな応用が期待されている。 In recent years, attention has been focused on processing for separating and synthesizing images for each object (object) using digital technology. In particular, in moving picture coding, the MPEG-4 coding system is standardized as an international standard. In the MPEG-4 encoding method, image data of an arbitrary shape can be handled, and encoding / decoding is performed for each object, thereby improving encoding efficiency, data distribution according to a transmission path, image reprocessing, and the like. Various applications that were difficult are expected.
また、動画像処理における対象物の抽出方法としては、一般に背景差分方式という手法が知られている。これは、予め撮影した背景画像と実際の入力画像とを比較することにより、変化点を検出する方法である。以下、簡単にその原理について説明する。 As a method for extracting an object in moving image processing, a method called a background difference method is generally known. In this method, a change point is detected by comparing a background image captured in advance with an actual input image. The principle will be briefly described below.
まず、画像平面上の座標(x,y)における点の入力画像の画素値をPc(x,y)、背景画像の画素値をPb(x,y)とする。このとき、Pc(x,y)とPb(x,y)との差分をとり、その絶対値をある閾値Thと比較する。 First, assume that the pixel value of the input image at the point at the coordinates (x, y) on the image plane is Pc (x, y), and the pixel value of the background image is Pb (x, y). At this time, the difference between Pc (x, y) and Pb (x, y) is taken and the absolute value is compared with a certain threshold Th.
判定式の例を示すと次の通りである。
if(|Pc(x,y)−Pb(x,y)| ≦ Th) S(x,y)=0;
else S(x,y)=1; … (1)
An example of the determination formula is as follows.
if (| Pc (x, y) −Pb (x, y) | ≦ Th) S (x, y) = 0;
else S (x, y) = 1; (1)
差分絶対値が閾値Th以下の場合、この点(x,y)は変化なしということで、Pc(x,y)は背景と判定され、S(x,y)=0となる。一方、差分絶対値が閾値Thを超えている場合は、値が変化したということで抽出対象とみなされS(x、y)=1となる。画面上のすべての点において上記の判定を行うことで、1フレーム分の抽出が完了する。 When the absolute difference value is equal to or smaller than the threshold Th, this point (x, y) is unchanged, and Pc (x, y) is determined as the background, and S (x, y) = 0. On the other hand, when the difference absolute value exceeds the threshold Th, it is regarded as an extraction target because the value has changed, and S (x, y) = 1. By performing the above determination at all points on the screen, extraction for one frame is completed.
図15は、背景差分方式とMPEG−4符号化方式を組み合わせた従来のシステムの構成を示すブロック図である。図15において、画像入力部2101は、例えばカメラの撮像部であり、動画像を入力する部分である。画像分離部2102は、背景画像として処理するフレームと任意形状画像として処理するフレームとを切り替えるスイッチ回路である。背景画像に設定したフレームは、矩形画像符号化部2104で、1フレーム分符号化される。形状データ生成部2103では、先の背景画像と現在入力された画像との比較により、形状データS(x,y)を生成する。一般に形状データS(x,y)は、オブジェクトであるか否かの2値データである。任意形状画像符号化部2105では、画像データと形状データを入力とし、符号化した結果をビットストリームとして出力する。多重化部2106では図示した矩形画像と任意形状画像の2種類のビットストリームの他に、オーディオのビットストリームなどを1本のデータにまとめるべく、多重化処理を行う。
FIG. 15 is a block diagram showing the configuration of a conventional system that combines the background difference method and the MPEG-4 encoding method. In FIG. 15, an
図17は、図15のブロック図をより具体的に説明するための図である。フレーム2301から2318は、画像入力部2101から入力されたフレームのデータ列であり、先頭のフレーム2301が背景のみが映っている画像、フレーム2311以降が抽出対象も映っている画像である。画像分離部2102では、フレーム2301を背景画像に、フレーム2311以降を任意形状画像に切り替えている。この切り替えの最も簡単な方法は、入力画像を見ながら、手動で操作するのが確実である。
FIG. 17 is a diagram for explaining the block diagram of FIG. 15 more specifically.
実際のデータ処理の流れを図19を用いて説明する。画像2500が背景画像2301に対応し、画像2501が任意形状画像2311に対応しているものとする。このとき、差分処理部2351では、画像2500と2501が入力され、先に説明した背景差分法により、対応する画素間の差が閾値以下か否かで2値化したデータを出力する。形状データ2511は2値化された形状データであり、黒い部分が背景、白い部分がオブジェクトを示している。同様に、画像2502、2503がそれぞれフレーム2312、2313に対応しているとすると、生成される形状データは、背景画像2500との差分閾値処理をした結果、形状データ2512、2513となる。
The actual data processing flow will be described with reference to FIG. Assume that the
図17では、任意形状画像符号化にMPEG−4のCore Profileのエンコーダ2353を用いている。以下、この符号化方式について説明する。
In FIG. 17, an MPEG-4
オブジェクト(対象物)を符号化する場合には、オブジェクトの形と位置の情報を符号化する必要がある。そのために、まず、オブジェクトを内包する矩形領域を設定し、この矩形の左上位置の座標と矩形領域の大きさを符号化する。この矩形領域はバウンディングボックスと呼ばれる。また、画像データ、形状データにより表現されるオブジェクト内部の領域をVOP(Video Object Plane)と呼ぶ。 When encoding an object (object), it is necessary to encode information on the shape and position of the object. For this purpose, first, a rectangular area containing the object is set, and the coordinates of the upper left position of the rectangle and the size of the rectangular area are encoded. This rectangular area is called a bounding box. A region inside the object expressed by image data and shape data is called a VOP (Video Object Plane).
図21は、図17の符号化部2353の細部構成を示すブロック図である。尚、入力されるデータは画像の輝度・色差データと形状データであり、それらはマクロブロック単位で処理される。
FIG. 21 is a block diagram illustrating a detailed configuration of the
まず、イントラモードでは、各ブロックをDCT部2701において離散コサイン変換(DCT)し、量子化部2702で量子化する。量子化されたDCT係数と量子化幅は、可変長符号化部2712で可変長符号化される。また、インターモードで利用する参照画像を生成するため、一旦量子化されたデータは、逆量子化部2703、逆DCT部2704を経て、画像データに戻される。これはローカルデコードの画像とも呼ばれる。この画像はメモリ部2705に保存される。
First, in the intra mode, each block is subjected to discrete cosine transform (DCT) in the
一方、インターモードでは、動き検出部2707においてメモリ部2705に保存されている時間的に隣接する別のVOPの中からブロックマッチングをはじめとする動き検出方法により動きを検出し、動きベクトル予測部2708で対象マクロブロックに対して誤差のもっとも小さい予測マクロブロックを検出する。誤差の最も小さい予測マクロブロックへの動きを示すデータが動きベクトルである。尚、予測マクロブロックを生成するために参照する画像を参照VOPと呼ぶ。
On the other hand, in the inter mode, the
検出された動きベクトルに基づいて、参照VOPを動き補償部2706において動き補償し、最適な予測マクロブロックを取得する。次に対象となるマクロブロックと対応する予測マクロブロックとの差分を求め、この差分画像に対してDCT部2701でDCTを施し、DCT変換係数を量子化部2702で量子化する。この時も量子化されたデータは、逆量子化部2703、逆DCT部2704を経て、画像データに戻される。この時の逆DCT部2704の出力は差分画像となるので、前の画像と合成した後、メモリ部2705に保存される。
Based on the detected motion vector, the
一方、形状データは、形状符号化CAE部2709で符号化される。但し、ここで実際にCAE符号化が行われるのは境界ブロックのみであり、VOP内のブロック(ブロック内全てのデータがオブジェクト内)やVOP外のブロック(ブロック内全てのデータがオブジェクト外)はヘッダ情報のみが可変長符号化部2712に送られる。また、CAE符号化が施される境界ブロックは、画像データと同様に、インターモードにおいては、動き検出部2707による動き検出を行い、動きベクトル予測部2708で動きベクトルの予測を行う。そして、動き補償した形状データと前フレームの形状データとの差分値に対しCAE符号化を行う。
On the other hand, the shape data is encoded by the shape encoding
また、図17では、矩形画像符号化にMPEG−4のSimple Profileのエンコーダ2352を用いている。以下、この符号化方式について説明する。Simple Profileのエンコーダ2352は、Core Profileのエンコーダ2353と下位互換がある。図21において、任意形状に関する処理、すなわち形状符号化CAE部2709、メモリ部2710、動き補償部2711を除いたものがSimple Profileのエンコーダとなる。画像データの処理手順は、Core Profileの画像データの処理と同じである。背景画像は1フレーム分符号化すればよいので、必ずしも動画像の符号化方式を用いなくてもよく、静止画符号化方式でもよい。
In FIG. 17, an MPEG-4
MUX処理部2354は、多重化部2106に対応し、多重化を行う。
The
次に復号側の処理について説明する。
図16が、全体の概略構成ブロック図である。符号化側で1本にまとめられたビットストリームは、分離部2201で各デコーダが入力できるビットストリームに分離処理される。このうち、符号化された背景画像は、矩形画像復号化部2202により1フレームの画像データに復号される。任意形状画像復号化部2203では、形状データと形状データに対応した画像データを復号する。画像合成部2204では、形状データの値を基に、背景画像と任意形状画像を画素単位で切り替え、合成画像を生成する。画像出力部2205は、一般的にはモニタ等の画像表示装置である。
Next, processing on the decoding side will be described.
FIG. 16 is an overall schematic block diagram. The bitstreams combined into one on the encoding side are separated into bitstreams that can be input by the decoders in the
図18と図20を用いて、図16のブロック図をより具体的に説明する。図16における分離部2201、矩形画像符号化部2202、任意形状符号化部2203、画像合成部2204がそれぞれ、図18におけるDEMUX処理2451、MPEG−4 Simple Profileのデコーダ2452、MPEG−4 Core Profileのデコーダ2453、合成処理部2454に対応している。フレーム2411から2418は、画像出力部2205において表示されるフレームのデータ列であり、図17における入力画像2311から2318に対応している。
The block diagram of FIG. 16 will be described more specifically with reference to FIGS. 18 and 20. The
MPEG−4 Simple Profileデコーダ2452の出力は図20における背景画像2600となる。背景画像は最初に1フレーム復号するだけなので、デコーダは静止画の復号化方式でもよい。また、背景画像は必ず他の画像と合成処理されるので、背景画像がそのまま出力されることはない。
The output of the MPEG-4
MPEG−4 Core Profileデコーダ2453は、まず形状データ2601、画像データ2611を出力する。合成処理2454では、形状データ2601で背景と判断されている画素に関しては、背景画像2600の画素を、オブジェクトと判断されている画素に関しては、画像データ2611の画素を選択し、合成画像2621を生成する。この画像は、符号化側における画像2501に対応している。画像2502に対応する復号画像は、形状データ2602と画像データ2612ならびに復号背景画像2600から合成され、画像2622となる。同様に、画像2503に対応する復号画像は、画像2623となる。
The MPEG-4
ここで、MPEG−4 Core Profileデコーダ2453の詳細を、図22を用いて説明する。基本的には図21の逆の動作であり、マクロブロック単位で、画像の輝度・色差データと形状データが復号される。
Details of the MPEG-4
まず、イントラモードでは、可変長復号化部2801が、量子化されたDCT係数の復号化を行い、それを逆量子化部2802に入力する。逆量子化部2802の出力は、復号したDCT係数となり、逆DCT部2803の入力となる。逆DCT部2803では、逆DCT処理を行うことにより、復号画像を出力する。この時の画像は、インターモードで利用する参照画像とするため、メモリ部2804に保存される。
First, in the intra mode, the variable
一方、インターモードでは、逆量子化部2802、逆DCT部2803を経て復号される画像は、フレーム間の差分画像である。また、動きベクトル復号部2806においては、動きベクトルを復号する。動き補償部2805では、復号した動きベクトルを用いてメモリ部2804に保存されている前フレームの画像から動き補償した画像を生成する。この画像と先の差分画像を合成することにより、インターモードにおける画像の復号が行われる。
On the other hand, in the inter mode, an image decoded through the
また、形状データは、可変長復号化部2801から形状復号化CAE部2807を経て復号される。インターモードの場合は、メモリ部2808に保存しておいた前フレームの形状データを動きベクトル復号化部2806によって復号した動きベクトルを用いて、動き補償部2809で動き補償した後、形状復号化CAE部2807にて復号される。
Further, the shape data is decoded from the variable
図18では、矩形画像復号化にMPEG−4のSimple Profileのデコーダ2452を用いている。以下、この符号化方式について説明する。Simple Profileのデコーダ2452は、Core Profileのデコーダ2453と下位互換がある。図22において、任意形状に関する処理、すなわち形状復号化CAE部2807、メモリ部2808、動き補償部2809を除いたものがSimple Profileのデコーダ2452となる。画像データの処理手順は、Core Profileの画像データの処理と同じである。背景画像は1フレーム分復号化すればよいので、必ずしも動画像の復号化方式を用いなくてもよく、静止画復号化方式でもよい。
In FIG. 18, an MPEG-4
しかしながら、上述したシステムは、あらかじめ背景のみの画像を用意しておかなければならないという欠点があった。また、入力画像と背景画像の間に相対的な位置のずれが生じると、正しくオブジェクトが抽出できない、という問題もある。カメラの動く範囲があらかじめわかっている場合は、下記の特許文献1に開示されているように、スプライトと呼ばれる広範囲の画像を用意しておくことで、ある程度の対策は可能だが、あらかじめ前準備が必要であることには変わりがない。
However, the system described above has a drawback in that an image of only the background must be prepared in advance. There is also a problem that an object cannot be correctly extracted if a relative position shift occurs between the input image and the background image. If the camera movement range is known in advance, it is possible to take some measures by preparing a wide range of images called sprites as disclosed in
つまり、上記のシステムは、精度のよい抽出結果を得るにはよい構成であるが、符号化効率の向上を目的としてみた場合、適応範囲が限定されてしまうため、単純に矩形の動画像符号化システムから任意形状の動画像符号化システムへ置き換えることができないという問題があった。 In other words, the above system is a good configuration for obtaining accurate extraction results, but the range of adaptation is limited for the purpose of improving the encoding efficiency, so that a rectangular moving image encoding is simply performed. There was a problem that the system could not be replaced with a video coding system of arbitrary shape.
本発明は、このような事情を考慮してなされたものであり、事前処理を必要とせず、矩形の動画像符号化システムとの単純な置き換えが可能である汎用性の高い高能率符号化技術を提供することを目的とする。 The present invention has been made in consideration of such circumstances, and does not require pre-processing, and can be simply replaced with a rectangular moving image encoding system. The purpose is to provide.
本発明の画像処理装置は、複数のフレームから構成される動画像を入力する動画像入力手段と、前記動画像の中から背景画像とするフレームを選択する際に、画像内の被写体の有無に関わらず背景画像とするフレームを選択する画像選択手段と、前記背景画像とするフレームと前記入力画像のフレームとを比較し、その差分値を基に形状データを生成する形状データ生成手段と、前記形状データを基に前記背景画像を補正する背景データ補正手段と、前記入力画像を前記形状データと共に任意形状画像として符号化する任意形状画像符号化手段とを有することを特徴とする。
また、本発明の画像処理方法は、複数のフレームから構成される動画像を入力する動画像入力ステップと、前記動画像の中から背景画像とするフレームを選択する際に、画像内の被写体の有無に関わらず背景画像とするフレームを選択する画像選択ステップと、前記背景画像とするフレームと前記入力画像のフレームとを比較し、その差分値を基に形状データを生成する形状データ生成ステップと、前記形状データを基に前記背景画像を補正する背景データ補正ステップと、前記入力画像を前記形状データと共に任意形状画像として符号化する任意形状画像符号化ステップとを有することを特徴とする。
The image processing apparatus according to the present invention detects a moving image input unit that inputs a moving image composed of a plurality of frames, and whether or not there is a subject in the image when selecting a frame as a background image from the moving images. Regardless of the image selection means for selecting a frame as a background image, the shape data generation means for comparing the frame as the background image and the frame of the input image, and generating shape data based on the difference value; The image processing apparatus includes a background data correcting unit that corrects the background image based on shape data, and an arbitrary shape image encoding unit that encodes the input image together with the shape data as an arbitrary shape image.
The image processing method according to the present invention also includes a moving image input step of inputting a moving image composed of a plurality of frames, and a selection of a frame as a background image from the moving images. An image selection step for selecting a frame as a background image regardless of the presence, a shape data generation step for comparing the frame as the background image with the frame of the input image, and generating shape data based on the difference value; A background data correction step for correcting the background image based on the shape data, and an arbitrary shape image encoding step for encoding the input image as an arbitrary shape image together with the shape data.
また、本発明のプログラムは、上記の画像処理方法の各ステップをコンピュータに実行させるためのプログラムである。
また、本発明の記録媒体は、上記の画像処理方法の各ステップをコンピュータに実行させるためのプログラムを記録したコンピュータ読み取り可能な記録媒体である。
The program of the present invention is a program for causing a computer to execute each step of the image processing method.
The recording medium of the present invention is a computer-readable recording medium recording a program for causing a computer to execute each step of the image processing method.
画像内の被写体の有無に関わらず背景画像とするフレームを選択することができるので、背景画像を設定するための事前処理が必要なくなる。また、矩形画像符号化手段を必要とせず、任意形状画像符号化手段のみで符号化することができる。また、背景データを補正することにより、動画像のノイズや微小変動による影響を抑制でき、復号後の合成画像においても、より自然な画像を得ることができる。 Since a frame as a background image can be selected regardless of the presence or absence of a subject in the image, pre-processing for setting the background image is not necessary. Further, the rectangular image encoding means is not required, and the encoding can be performed only by the arbitrary shape image encoding means. Further, by correcting the background data, it is possible to suppress the influence of moving image noise and minute fluctuations, and it is possible to obtain a more natural image even in a composite image after decoding.
以下、図面を参照して、本発明の好適な実施形態について詳細に説明する。
<第1の実施形態>
本発明の第1の実施形態について説明する。図1(a)は、符号化側の全体構成を示すブロック図である。背景技術で説明した図15との大きな違いは、背景画像と任意形状画像の選択方法が異なる(画像選択部101)こと、形状データ生成後にそれを反映させた背景データ補正部104を設けていること、矩形形状符号化部2104が不要であること、などである。図17における2301に相当する背景画像というものをあらかじめ用意しておかないことが、本実施形態の大きな特徴である。本実施形態では、フレーム列の中から背景画像を選択し、符号化する。
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the drawings.
<First Embodiment>
A first embodiment of the present invention will be described. FIG. 1A is a block diagram showing an overall configuration on the encoding side. The major difference from FIG. 15 described in the background art is that the selection method of the background image and the arbitrary shape image is different (image selection unit 101), and the background
画像入力部2101から入力された複数のフレーム列から構成される動画像は、画像選択部101によって、背景とするフレームとそれ以外のフレームに選択される。その際、画像内の被写体の有無に関わらず背景とするフレームを選択する。形状データ生成部103では、フレーム画像を入力し、その入力画像のフレームと背景のフレームとを比較し、そのフレーム差分により生成したデータを2値化して任意形状符号化用の形状データを生成する。背景データ補正部104では、背景として選択されたフレームを、形状データの生成結果を基に補正処理を行う。任意形状画像符号化部2105では、先に生成した形状データと画像データを同じフレームのタイミングで入力し、符号化を行う。その際、イントラモード(フレーム内符号化)とインターモード(フレーム間符号化)とを切り替えて行う。また、タイミングを合わせるためのデータ一時保存(メモリ)機能については、ここでは明示しないが、各機能ブロックが有しているものとする。画像データの符号化および形状データの符号化の詳細は、背景技術で説明したとおりである。多重化部2106は、複数のエンコードしたビットストリームの多重化を行う。ビデオの他にオーディオのビットストリームなども多重化する部分であるが、ここでは特に本発明固有の処理がないため、説明を省略する。
A moving image composed of a plurality of frame sequences input from the
背景画像の選択方法は後に詳しく説明するが、ここではまず、その後の処理である、形状データの生成とそれに伴う背景データの補正処理について、図3の画面イメージ、および図5、図6、図7のフローチャートを用いて説明する。 The background image selection method will be described in detail later. First, regarding the subsequent generation of shape data generation and background data correction processing associated therewith, the screen image of FIG. 3 and FIGS. This will be described with reference to the flowchart of FIG.
まず図5のステップS701にて、最初の画像を入力する。ここでは、図3の画像501を最初の画像とする。背景フレームの判定ステップS702で、このフレームは背景と判定されるので、ステップS703にて、一時保存される。一時保存は差分処理を行うためのものである。次にステップS704にて、このフレームの形状データとして、全画面(全画素)オブジェクトの形状データを生成する。形状データ511は、この形状データを示している。終了判定S709では最終フレームか否かの判定を行う。この時点ではNOなので、ステップS701に戻り、次のフレームの画像入力に移る。2番目の画像502は、背景フレーム判定S702において、NOと判定されるので、ステップS705に進み、背景フレームとの差分検出を行う。このとき背景となる画像が、先ほど一時保存しておいたフレーム501である。ステップS706にて、差分値の2値化を行い、形状データ生成する。フレーム501と502の差分値から生成される形状データは、形状データ512となる。補正判定ステップS707では、背景フレームの補正を行うか否かの判定を行う。判定方法の詳細は後に説明する。ここでは、NOと判定として、ステップS701に戻る。3番目の画像503は、背景フレーム判定S702において、NOと判定されるので、2番目の画像502と同様、ステップS705、S706の処理を行う。フレーム501と503の差分値から生成される形状データは、形状データ513となる。補正判定ステップS707で、YESと判定されると、ステップS708に進み、背景データの補正を行う。背景データ補正時には、背景フレームを含むすべての入力画像と、各フレームにおける形状データの生成結果を利用する。補正方法の詳細は後ほど説明する。ステップS709の終了判定では、すべてのフレームを処理したかどうかを判定し、終了(YES)ならば一連の処理を終える。
First, in step S701 in FIG. 5, the first image is input. Here, the
次に図6(a)を用いて、背景フレーム以外のフレームを処理する方法の詳細を説明する。図6(a)において、ステップS801では、背景データ補正に必要な初期設定処理を行う。初期設定処理の詳細を、図7(b)に示す。ステップS808のカウント値のセットは、各位置で背景と判定されたデータがいくつあるかを示すカウンタ値をセットするものである。ある位置(x,y)におけるカウンタ値をc(x,y)とすると、背景フレームのみを入力した状態では、画面全体で次式になる。 Next, details of a method for processing frames other than the background frame will be described with reference to FIG. In FIG. 6A, in step S801, an initial setting process necessary for background data correction is performed. Details of the initial setting process are shown in FIG. The setting of the count value in step S808 is to set a counter value indicating how many data are determined to be background at each position. Assuming that the counter value at a certain position (x, y) is c (x, y), the following equation is obtained for the entire screen when only the background frame is input.
c(x,y)=1 ・・・(2) c (x, y) = 1 (2)
ステップS809の画素値のセットは、各位置における背景の累積画素値の初期設定をするものである。ある位置(x,y)における画素値をp(x,y)とすると、背景フレームのみを入力した状態では、p(x,y)は背景フレームの画素値そのものとなる。ステップS810の終了判定で、画面内の全画素を処理した段階でこの初期設定は終了となる。水平方向の画素数をW、垂直方向の画素数をHとすると、W×Hの回数だけ上記の処理を行うことになる。RGBのカラー画像の場合はW×H×3、4:2:2と呼ばれるフォーマットの場合はW×H×2となる。図3のフレーム501を背景フレームとすると、領域551すなわち画面上すべての位置で、累積画素値は背景フレームの画素値となる。
The set of pixel values in step S809 is for initial setting of the cumulative pixel value of the background at each position. Assuming that the pixel value at a certain position (x, y) is p (x, y), p (x, y) is the pixel value of the background frame when only the background frame is input. This initial setting ends when all the pixels in the screen are processed in the end determination in step S810. If the number of pixels in the horizontal direction is W and the number of pixels in the vertical direction is H, the above processing is performed the number of times W × H. In the case of an RGB color image, W × H × 3, and in the case of a format called 4: 2: 2, the format is W × H × 2. Assuming that the
図6(a)のステップS802では、背景以外のフレームを入力し、ステップS803で、背景データ補正のための前処理を行う。詳細を、図7(c)を用いて説明する。まず、ステップS811にてあらかじめ保存しておいた背景フレームと、現入力との差分値を検出する。ステップS812にて、差分値と閾値の比較を行い、2値化する。ステップS813にて、2値化した結果の形状データが背景だった場合は、ステップS814にて、画素数のカウントを行う。ある位置(x,y)の2値化した結果が背景であったとすると、c(x,y)は、0から1になる。ステップS815では、画素値の加算を行う。(x,y)における最初の背景フレームの画素値が52で、現フレームの画素値が50であったとすると、加算後の画素値は次式になる。 In step S802 of FIG. 6A, a frame other than the background is input, and in step S803, preprocessing for background data correction is performed. Details will be described with reference to FIG. First, a difference value between the background frame stored in advance in step S811 and the current input is detected. In step S812, the difference value and the threshold value are compared and binarized. If the binarized shape data is background in step S813, the number of pixels is counted in step S814. If the binarized result at a certain position (x, y) is the background, c (x, y) is changed from 0 to 1. In step S815, pixel values are added. If the pixel value of the first background frame at (x, y) is 52 and the pixel value of the current frame is 50, the pixel value after the addition is as follows.
p(x,y)=52+50=102 ・・・(3) p (x, y) = 52 + 50 = 102 (3)
また、2値化した結果が背景でなかった場合は、何も処理は行わない。これらの処理を画面内の全画素数だけ繰り返す。図3のフレーム502を最初の背景以外のフレームとすると、形状データ512における黒の領域がこのフレームにおける背景領域となる。したがって、領域553が、背景フレームの画素値、領域552が、フレーム501の画素値とフレーム502の画素値を加算した値となる。
If the binarized result is not the background, no processing is performed. These processes are repeated for the total number of pixels in the screen. If the
全部の画素の処理が終了した段階(ステップS816の判定がYES)で一連の前処理を終える。 A series of pre-processing is finished at the stage where all the pixels have been processed (YES in step S816).
ステップS804は、補正の後処理を開始するか否かの判定処理である。1つの背景フレームから、次の背景フレームまでの期間が、ひとつの処理単位となるので、次の背景フレームの直前のフレームまでは、ループ処理を繰り返す。背景フレームの挿入間隔が一定の場合には、次の背景フレームが来る前に判定が可能である。背景フレームの間隔が一定でない場合は、次の背景フレームを検出するまで、それまでの処理内容を保持しておく必要がある。また、最終フレームを検出した場合も、それまでの結果から後処理に移ることになる。図3のフレーム503を背景直前のフレームとすると、形状データ513の形状データ生成結果から、背景データの重なり具合によって、いくつかの領域が生じる。領域553は、フレーム501でのみ背景と判定された領域であり、この領域におけるカウンタ値c(x,y)は1であり、累積画素値は、背景フレーム501の画素値そのものである。領域555は、フレーム501と502で背景と判定された領域であり、この領域におけるカウンタ値c(x,y)は2、累積画素値は、501と502の画素値の和となる。領域554は、フレーム501、502、503で背景と判定された領域であり、この領域におけるカウンタ値c(x,y)は3、累積画素値は、フレーム501、502、503の画素値の和となる。
Step S804 is a process for determining whether or not to start the post-correction process. Since the period from one background frame to the next background frame is one processing unit, the loop processing is repeated until the frame immediately before the next background frame. If the background frame insertion interval is constant, the determination can be made before the next background frame arrives. If the interval between the background frames is not constant, it is necessary to retain the processing contents until then until the next background frame is detected. Also, when the last frame is detected, post-processing is performed from the previous result. Assuming that the
ステップS805は、背景データ補正の後処理である。図7(d)を用いて説明する。ステップS817で、平均画素値を算出する。これまで累積してきた画素値とカウンタ値から、ある位置(x,y)の平均画素値a(x,y)は、次式で求めることができる。 Step S805 is post-processing of background data correction. This will be described with reference to FIG. In step S817, an average pixel value is calculated. From the pixel values and counter values accumulated so far, the average pixel value a (x, y) at a certain position (x, y) can be obtained by the following equation.
a(x,y)=p(x,y)/c(x,y) ・・・(4) a (x, y) = p (x, y) / c (x, y) (4)
この処理を画面内の全画素数だけ繰り返し、全部の画素の処理が終了した段階(ステップS818の判定がYES)で一連の後処理を終える。図3においては、領域553では、カウンタ値1なので、平均画素値は、累積画素値のまま、領域555では、カウンタ値2なので、平均画素値は、累積画素値/2、領域554では、カウンタ値3なので、平均画素値は、累積画素値/3となる。すなわち、背景画像と形状データの共通領域を求め、その共通領域毎の平均画像を生成し、1枚の合成背景画像データを生成する。
This process is repeated for the total number of pixels in the screen, and the series of post-processing is finished at the stage where the processing of all the pixels is completed (the determination in step S818 is YES). In FIG. 3, since the counter value is 1 in the
ステップS806は、最終の終了判定であり、シーケンスの最終フレームの処理が終わり(YES)ならば、終了となる。 Step S806 is a final end determination. If the processing of the last frame of the sequence is completed (YES), the process ends.
このように、複数のフレームを用いて画像を平均化することにより、ノイズや微小変動による影響を抑制でき、復号後の合成画像においても、より自然な画像を得ることができる。図1の任意形状符号化部2105には、この補正した背景データと、その形状データ511を入力することになる。
In this way, by averaging images using a plurality of frames, the influence of noise and minute fluctuations can be suppressed, and a more natural image can be obtained even in a composite image after decoding. The corrected background data and its
先に説明したように、MPEG−4任意形状画像符号化方式では、フレーム内の処理を行うイントラモード(フレーム内符号化)と、フレーム間の処理を行うインターモード(フレーム間符号化)がある。符号化の処理モードをどう選ぶかという問題は、背景に設定するフレームをどう決めるかという問題と直接の関連はなく、自由に設定可能である。ただし、背景に設定したフレームをイントラモードにすると、効率のよい符号化が可能となる。インターモードでは、形状データもフレーム間のマッチングを取るため、各フレームの形状データが似ている場合は、形状データにおける発生符号量を小さくすることができる。フレーム511をイントラモードとして、フレーム512、513をインターモードとすると、形状データ513は、形状データ512と似ているため、発生符号量は、少なくて済むことになる。
As described above, in the MPEG-4 arbitrary shape image coding method, there are an intra mode (intra-frame coding) for performing processing within a frame and an inter mode (inter-frame coding) for performing processing between frames. . The problem of how to select the encoding processing mode is not directly related to the problem of how to determine the frame to be set as the background, and can be freely set. However, if the frame set as the background is set to the intra mode, efficient encoding becomes possible. In the inter mode, the shape data is also matched between frames, so that if the shape data of each frame is similar, the amount of generated codes in the shape data can be reduced. When the
ここで、背景フレームの設定方法について、図10から図13を用いて説明する。図10は、シーンの内容とは無関係に周期的に背景を選択する方法である。先頭フレームから周期的に背景を更新することにより、画像の内容が変化しても発生符号量を抑えることができる。まず初期設定としてステップS1201にてフレーム数をカウントする値iを0にセットする。次にステップS1202にて、現フレームが先頭フレームであるか否かを判定する。カウント値i=0ならば、先頭フレームなので、ステップS1204にて背景フレームと設定する。先頭フレームでない場合は、ステップS1203にて、現フレームが周期Tの倍数か否かを判定する。カウント値iを周期Tで割った余りが0ならば、周期Tの倍数なので、ステップS1204にて背景フレームと設定する。現フレームが周期Tの倍数でない場合は、背景設定をせずに終了判定のステップS1205に進む。最終フレームでなければ、終了判定S1205はNOとなり、ステップS1206にてフレーム数のカウント値iを1つ増やして、ステップS1202に戻り、次のフレームの処理に移る。以下同様の処理を繰り返し、最終フレームの処理が終わった段階で、終了判定S1205がYESとなり、一連の処理を終える。 Here, a background frame setting method will be described with reference to FIGS. FIG. 10 shows a method of selecting a background periodically regardless of the contents of the scene. By periodically updating the background from the first frame, the generated code amount can be suppressed even if the content of the image changes. First, as an initial setting, a value i for counting the number of frames is set to 0 in step S1201. In step S1202, it is determined whether the current frame is the top frame. If the count value i = 0, since it is the first frame, it is set as a background frame in step S1204. If it is not the first frame, it is determined in step S1203 whether or not the current frame is a multiple of the period T. If the remainder obtained by dividing the count value i by the period T is 0, it is a multiple of the period T, so that a background frame is set in step S1204. If the current frame is not a multiple of the period T, the process proceeds to step S1205 for end determination without setting the background. If it is not the last frame, the end determination S1205 is NO, the count value i of the number of frames is incremented by 1 in step S1206, the process returns to step S1202, and the process for the next frame is started. Thereafter, the same processing is repeated, and when the final frame processing is completed, the end determination S1205 is YES, and the series of processing ends.
図11は、動画像のシーンの内容を解析し、シーンチェンジが発生したところで背景フレームを設定する方法であり、図10とは異なる方法を示している。シーンチェンジ検出直後の画像は直前の画像との相関が低いため、大きな差分データを発生してしまう。シーンチェンジが発生したフレームを背景とすることで、シーンにまたがっての差分処理を防ぎ、発生符号量を抑えることができる。まずステップS1301にて、現フレームが先頭フレームか否かの判定を行い、先頭フレームならば、ステップS1303にて背景フレームに設定する。現フレームが先頭フレームでない場合は、ステップS1302にて、シーンチェンジが発生しているか否かの判定を行う。シーンチェンジ検出法は、本実施形態に特に限定されるものはないが、フレーム間の差分絶対値を閾値処理により2値化し、閾値を超える領域の面積によって判定するのはその一例である。このようにして、現フレームがシーンチェンジを発生したフレームであると判定されると、ステップS1503にて背景フレームに設定する。シーンチェンジがなければ、背景設定をせずに終了判定のステップS1304に進む。最終フレームでなければ、終了判定S1304はNOとなり、ステップS1301に戻り、次のフレームの処理に移る。以下同様の処理を繰り返し、最終フレームの処理が終わった段階で、終了判定S1304がYESとなり、一連の処理を終える。 FIG. 11 shows a method of analyzing the contents of a moving image scene and setting a background frame when a scene change occurs, and shows a method different from FIG. Since the image immediately after the scene change detection has a low correlation with the immediately preceding image, large difference data is generated. By using a frame in which a scene change has occurred as a background, difference processing across scenes can be prevented, and the amount of generated codes can be suppressed. First, in step S1301, it is determined whether or not the current frame is the first frame. If the current frame is the first frame, the background frame is set in step S1303. If the current frame is not the first frame, it is determined in step S1302 whether a scene change has occurred. The scene change detection method is not particularly limited to this embodiment, but one example is that the absolute value of the difference between frames is binarized by threshold processing and the determination is made based on the area of the region exceeding the threshold. In this way, when it is determined that the current frame is a frame in which a scene change has occurred, the background frame is set in step S1503. If there is no scene change, the process proceeds to step S1304 for end determination without setting the background. If it is not the last frame, the end determination S1304 is NO, the process returns to step S1301, and the process proceeds to the next frame. Thereafter, the same processing is repeated, and when the processing of the last frame is completed, the end determination S1304 becomes YES, and the series of processing is finished.
図12は、図10と図11を組み合わせた背景フレーム設定法である。毎回周期T毎に背景を設定するが、それ以外にもシーンチェンジがあるフレームは背景とする。まず、ステップS1401にて、フレーム数を数えるカウンタ値iを0に初期設定する。次にステップS1402にて、iが0かどうかの判定を行う。これは、先頭フレームか否かの判定となる。先頭フレームならば、ステップS1405に進み、背景フレームに設定する。先頭フレームでない場合は、ステップS1403にて現フレームが周期Tの倍数か否かの判定を行う。判定は、フレーム値iを周期Tで割った余りが0ならば、倍数とするのが簡便な方法である。現フレームが周期Tの倍数ならば、ステップS1405にて、背景フレームに設定し、そうでなければ、ステップS1404のシーンチェンジ判定に進む。シーンチェンジがあればステップS1405にて背景フレームに設定し、そうでなければ、終了判定ステップS1406に進む。終了判定では最終フレームか否かの判定を行い、最終フレームでない場合は、ステップS1407にてカウンタ値iを1つ増やし、ステップS1402からの処理を繰り返す。最終フレームを処理した段階で終了判定のループを抜け、一連の処理を終了する。 FIG. 12 shows a background frame setting method combining FIG. 10 and FIG. A background is set every time period T, but other frames with scene changes are used as the background. First, in step S1401, a counter value i for counting the number of frames is initialized to 0. Next, in step S1402, it is determined whether i is 0 or not. This is a determination as to whether or not it is the first frame. If it is the first frame, the process advances to step S1405 to set the background frame. If it is not the first frame, it is determined whether or not the current frame is a multiple of the period T in step S1403. For the determination, if the remainder obtained by dividing the frame value i by the period T is 0, a simple method is to use a multiple. If the current frame is a multiple of the period T, it is set as a background frame in step S1405. Otherwise, the process proceeds to the scene change determination in step S1404. If there is a scene change, the background frame is set in step S1405; otherwise, the process proceeds to end determination step S1406. In the end determination, it is determined whether or not it is the final frame. If it is not the final frame, the counter value i is incremented by 1 in step S1407, and the processing from step S1402 is repeated. When the final frame is processed, the end determination loop is exited, and the series of processing ends.
図13も、図10と図11を組み合わせた他の背景フレーム設定法である。図13の場合は、図12の場合と異なり、シーンチェンジ検出後、シーンチェンジのない区間の続く場合に周期的に背景を設定する。まず、ステップS1501にて、先頭フレームか否かの判定を行う。先頭フレームの判定方法は先に説明した方法でよい。先頭フレームならば、ステップS1503にて、背景フレームに設定し、ステップS1504にてフレームのカウンタ値iを1にセットする。ここでのカウンタ値iは先ほど説明した先頭からのフレーム数ではなく、背景フレームを常に1として、そこからのフレーム数を数えるものである。先頭フレームでなければ、ステップS1502で、シーンチェンジの判定を行う。シーンチェンジのフレームであれば、ステップS1503にて、背景フレームに設定し、ステップS1504にてカウンタ値iを1に設定する。シーンチェンジのフレームでなければ、ステップS1505にて、フレームのカウンタ値iを1つ増やす。背景フレームの直後であれば、i=2となる。次にステップS1506にて現フレームが周期Tの倍数か否かを判定する。判定方法としては、背景フレームからのカウント値iが周期Tと同じ値ならば、Tの倍数とするが簡便である。現フレームが周期Tの倍数ならば、ステップS1503にて、背景フレームに設定し、ステップS1504にてカウンタ値iを1に設定する。また、背景フレームからのカウント値iが周期Tに満たなければ、ステップS1507の終了判定に進む。終了判定では最終フレームか否かの判定を行い、最終フレームでない場合は、ステップS1501からの処理を繰り返す。これにより、シーンチェンジを検出時に背景フレーム設定をし、シーンチェンジがない区間が続く場合は、周期Tで背景フレーム設定をする、ということが可能となる。最終フレームを処理した段階で終了判定S1507はYESとなり、一連の処理を終了する。 FIG. 13 is another background frame setting method combining FIG. 10 and FIG. In the case of FIG. 13, unlike the case of FIG. 12, after the scene change is detected, the background is periodically set when a section without a scene change continues. First, in step S1501, it is determined whether it is the first frame. The method for determining the first frame may be the method described above. If it is the first frame, the background frame is set in step S1503, and the frame counter value i is set to 1 in step S1504. The counter value i here is not the number of frames from the top described above, but always counts the number of frames from the background frame as 1. If it is not the first frame, the scene change is determined in step S1502. If it is a scene change frame, the background frame is set in step S1503, and the counter value i is set to 1 in step S1504. If it is not a scene change frame, the frame counter value i is incremented by one in step S1505. If it is immediately after the background frame, i = 2. In step S1506, it is determined whether the current frame is a multiple of the period T. As a determination method, if the count value i from the background frame is the same value as the period T, a multiple of T is convenient. If the current frame is a multiple of the period T, the background frame is set in step S1503, and the counter value i is set to 1 in step S1504. On the other hand, if the count value i from the background frame does not reach the period T, the process proceeds to step S1507 to determine the end. In the end determination, it is determined whether or not it is the final frame. If it is not the final frame, the processing from step S1501 is repeated. As a result, it is possible to set the background frame when detecting a scene change, and to set the background frame at the period T when a section without a scene change continues. When the final frame is processed, the end determination S1507 is YES, and the series of processing ends.
次に、第1の実施形態で説明した符号化側の処理に対応する復号化側の処理について、図2、図4、図14を用いて説明する。 Next, decoding-side processing corresponding to the encoding-side processing described in the first embodiment will be described with reference to FIGS. 2, 4, and 14.
図2は、復号化側の全体構成を示すブロック図である。分離部2201では、複数のビットストリームをデコーダ毎のビットストリームに分離する。ビットストリームの種類としては、ビデオの他にオーディオなどもあるが、ここでは本実施形態固有の処理であるビデオのビットストリームについてのみ図示している。任意形状画像復号化部2203では、分離されたビデオのビットストリームを入力し、画像データと形状データを復号画像として出力する。これは、背景技術で説明したMPEG−4 Core Profileのデコーダを用いるのがよい。画像合成部201では、入力した背景画像と現フレームの画像データおよび形状データから合成画像を生成し、画像出力部2205へ出力する。画像出力部2205は、ディスプレイのような画像表示装置が代表的なものであり、入力したフレームを所望のタイミングで順次表示する。
FIG. 2 is a block diagram showing the overall configuration on the decoding side. The
画像合成部201の処理手順を、図14のフローチャートを用いて説明する。まずステップS1801にて、最初に入力されたフレームが背景かどうかの判定を行う。形状データが全画素オブジェクトであれば、その画像は背景であると判定できる。入力されたフレームが背景ならば、ステップS1802にて、合成のためにデータを一時保存する。ステップS1803では、背景フレームと現フレームとの合成を行うが、この時点では現フレームが背景フレームなので、ステップS1804では現フレームをそのまま出力する。ステップS1805の終了判定では最終フレームか否かの判定を行い、最終フレームでない場合は、ステップS1801に戻り、次のフレームの判定を行う。背景フレームでない場合は、ステップS1803にて先ほど一時保存した背景画像と現フレームの任意形状画像との合成を形状データを基にして行う。合成した画像は、ステップS1804にて出力し、終了判定ステップS1805に進む。以上の処理を繰り返し、最終フレームを処理した段階で終了判定のループを抜け、一連の処理を終了する。
The processing procedure of the
図4において最初のフレームでは、画像データ611が任意形状の画像データ、形状データ601がその形状データ、画像データ641が合成画像データである。形状データ601がすべてオブジェクトを示しているので、画像データ611がそのまま合成後の出力画像641になっている。次のフレームでは、画像データ612が任意形状の画像データ、形状データ602がその形状データ、画像データ641が背景画像データである。形状データ602の黒い部分はオブジェクトでないので、背景画像データ641の画素を当てはめ、白い部分はオブジェクトなので、画像データ612の画素を当てはめる。各画素単位で画像データ641もしくは612の画素値を当てはめていくことにより、合成画像642を得ることができる。同様に、背景画像データ641と任意形状画像データ613を形状データ603に基づいて処理すると、合成画像643を得ることができる。
In the first frame in FIG. 4, the
上述したように、第1の実施形態に係る画像処理装置によれば、あらかじめ背景画像を用意するような構成を採らなくても、連続して入力するフレームの中から背景画像と任意形状画像を選択することにより、シーンに限定されない汎用的な高能率符号化システムを実現することができる。特に背景データの補正処理により、ノイズや微小変動による影響を抑制でき、復号後の合成画像においても、より自然な画像を得ることが可能となる。 As described above, according to the image processing apparatus according to the first embodiment, a background image and an arbitrary shape image can be extracted from frames that are continuously input without adopting a configuration in which a background image is prepared in advance. By selecting, a general-purpose high-efficiency encoding system that is not limited to a scene can be realized. In particular, the background data correction process can suppress the influence of noise and minute fluctuations, and a more natural image can be obtained even in a composite image after decoding.
<第2の実施形態>
本発明の第2の実施形態について説明する。全体構成を図1(b)に示す。第1の実施形態との違いは、背景データ補正部104によって得られたデータを、形状データの補正に利用することにある。図1(a)の形状データ生成部103を図1(b)では、形状データ生成・補正部105としている。この2つの機能ブロックにおける画像データと形状データの処理手順を、図8、図9のフローチャートを用いて詳しく説明する。なお、図8には第1の実施形態の図5が、図9には第1の実施形態の図6が、それぞれ対応しており、同じ処理を行う部分については、同じ番号を付してある。
<Second Embodiment>
A second embodiment of the present invention will be described. The overall configuration is shown in FIG. The difference from the first embodiment is that the data obtained by the background
まず図8を用いて、全体の処理の流れを示す。ステップS701からステップS707までの処理は、図5で説明したとおりである。ステップS708にて、背景データの補正を行うが、第1の実施形態では、ひとつの処理区間につき1回補正するのみであった。ステップS1001では、ステップS708の背景補正データを基に、形状データの補正を行う。形状データの補正を行うと、そのフレーム内で背景と判定される領域も変化するので、その情報を基に再度ステップS708にて、背景データの補正を行う。この処理をステップS1002の補正終了判定がYESとなるまで繰り返す。補正終了判定がYESとなった時点で、ひとつの背景フレームに対応した区間の処理が終わり、次の背景フレームに対応した区間の処理を開始する。最終フレームまで処理すると、ステップS709の終了判定がYESとなり、一連の処理を終了する。 First, the overall processing flow will be described with reference to FIG. The processing from step S701 to step S707 is as described in FIG. In step S708, the background data is corrected. In the first embodiment, the correction is performed only once for each processing section. In step S1001, the shape data is corrected based on the background correction data in step S708. When the shape data is corrected, the area determined to be the background within the frame also changes, so that the background data is corrected again in step S708 based on the information. This process is repeated until the correction end determination in step S1002 is YES. When the correction end determination is YES, the process for the section corresponding to one background frame is completed, and the process for the section corresponding to the next background frame is started. When the process reaches the last frame, the end determination in step S709 is YES, and the series of processes ends.
次に図9を用いて、背景フレーム以外のフレームを処理する方法の詳細を説明する。まずステップS801にて、図6で説明した初期設定を行う。次にステップS1101にて、フレーム数カウントのための初期設定を行う。ここでは、カウント値k=0とする。ステップS802にて、画像の入力をし、ステップS1102にて、フレーム数をカウントする。最初の背景以外のフレームを入力した時点では、k=1となる。次にステップS803にて、図6で説明した前処理を行う。ステップS804は、ひとつの背景に対し、処理するフレームの最後を判定するものである。次のフレームが背景である場合、またはシーケンスの最後のフレームである場合は、YESとなり、処理終了となる。NOの場合はステップS802からS803の処理を繰り返し、繰り返した回数がkのカウント値となる。ここでは、k=kmaxとする。このループを抜けると、ステップS805にて、背景補正の後処理を行う。ここまでの処理により、補正後の背景データが得られることになる。この背景データを用いて、形状データの補正処理に進む。ステップS1103にて、処理するフレーム数をカウントする。ここでは、kmaxからカウントダウンを行う。ステップS1104では、新たな背景データを用いて前処理を行う。この処理は、ステップS1105にて終了と判定するまで、繰り返す。終了フレーム数の判定は、カウント値k=0となった時点で、YESとなる。ここで、ステップS1106の後処理を行うと、最初に補正した背景データを用いて生成した補正形状データと、補正形状データによって再度補正された背景データが得られることになる。ステップS1107は、この再補正処理を何回繰り返すかの判定処理である。終了条件に満たない場合は、ステップS1108にて、0になったカウンタ値を再度kmaxに設定し、ステップS1103からの処理を繰り返す。ステップS1107の終了判定は、あらかじめ設定した回数の繰り返すという方法でも良いし、繰り返し毎に背景データや形状データの変化量を算出し、それが閾値以下の場合に繰り返しを打ち切る、といった動的な処理方法としても良い。このループを抜けると、ひとつの背景フレームに対応した区間の処理が終わることになる。最終フレームまで処理すると、ステップS806の終了判定がYESとなり、一連の処理を終了する。 Next, details of a method of processing frames other than the background frame will be described with reference to FIG. First, in step S801, the initial setting described with reference to FIG. 6 is performed. In step S1101, initial setting for counting the number of frames is performed. Here, the count value k = 0. In step S802, an image is input, and in step S1102, the number of frames is counted. When a frame other than the first background is input, k = 1. In step S803, the preprocessing described with reference to FIG. 6 is performed. Step S804 determines the end of the frame to be processed for one background. If the next frame is the background, or if it is the last frame in the sequence, the determination is YES and the process ends. In the case of NO, the processing from step S802 to S803 is repeated, and the number of repetitions becomes the count value of k. Here, k = kmax. When this loop is exited, background correction post-processing is performed in step S805. Through the processing so far, corrected background data is obtained. Using this background data, the process proceeds to the shape data correction process. In step S1103, the number of frames to be processed is counted. Here, the countdown is performed from kmax. In step S1104, preprocessing is performed using new background data. This process is repeated until it is determined to end in step S1105. The determination of the number of end frames is YES when the count value k = 0. Here, when the post-processing of step S1106 is performed, corrected shape data generated using the first corrected background data and background data corrected again by the corrected shape data are obtained. Step S1107 is a determination process of how many times this re-correction process is repeated. If the end condition is not satisfied, the counter value that has become 0 is set to kmax again in step S1108, and the processing from step S1103 is repeated. The determination of the end of step S1107 may be a method of repeating a preset number of times, or a dynamic process such as calculating the amount of change in the background data or shape data for each repetition and aborting the repetition when it is less than or equal to the threshold value. It is good as a method. When this loop is exited, the processing for the section corresponding to one background frame is completed. When the process reaches the last frame, the end determination in step S806 is YES, and the series of processes ends.
このように、複数のフレームを用いて背景データを補正し、更に補正した背景データを用いて、形状データの補正を行う、といった処理を繰り返すと、より精度の高い背景データならびに形状データが得られることとなる。図1(b)の任意形状符号化部2105には、この補正した背景データと補正した形状データを入力することになる。
As described above, when the background data is corrected using a plurality of frames and the shape data is corrected using the corrected background data, more accurate background data and shape data can be obtained. It will be. The corrected background data and the corrected shape data are input to the arbitrary
また、背景フレームの設定方法については、第1の実施形態で説明したものと同様である。更に、復号側の処理についても、同様なので、ここでは説明を省略する。 The background frame setting method is the same as that described in the first embodiment. Further, since the process on the decoding side is the same, the description is omitted here.
上述したように、第2の実施形態に係る画像処理装置によれば、あらかじめ背景画像を用意するような構成を採らなくても、連続して入力するフレームの中から背景画像と任意形状画像を選択することにより、シーンに限定されない汎用的な高能率符号化システムを実現することができる。特に背景データならびに形状データの補正処理により、高精度の抽出結果が得られ、高能率の符号化が可能となる。 As described above, according to the image processing apparatus according to the second embodiment, a background image and an arbitrary shape image can be selected from frames that are continuously input without adopting a configuration in which a background image is prepared in advance. By selecting, a general-purpose high-efficiency encoding system that is not limited to a scene can be realized. In particular, the background data and the shape data correction process provides a highly accurate extraction result, and enables highly efficient encoding.
<第3の実施形態>
図23は、本発明の第3の実施形態によるコンピュータのハードウエア構成例を示す。本実施形態は、前記第1及び第2の実施形態の装置をコンピュータで実現する例を示す。
<Third Embodiment>
FIG. 23 shows a hardware configuration example of a computer according to the third embodiment of the present invention. The present embodiment shows an example in which the devices of the first and second embodiments are realized by a computer.
バス2901には、中央処理装置(CPU)2902、ROM2903、RAM2904、ネットワークインタフェース2905、入力装置2906、出力装置2907及び外部記憶装置2908が接続されている。
A central processing unit (CPU) 2902, a
CPU2902は、データの処理又は演算を行うと共に、バス2901を介して接続された各種構成要素を制御するものである。ROM2903には、予めCPU2902の制御手順(コンピュータプログラム)を記憶させておき、このコンピュータプログラムをCPU2902が実行することにより、起動する。外部記憶装置2908にコンピュータプログラムが記憶されており、そのコンピュータプログラムがRAM2904にコピーされて実行される。RAM2904は、データの入出力、送受信のためのワークメモリ、各構成要素の制御のための一時記憶として用いられる。外部記憶装置2908は、例えばハードディスク記憶装置やCD−ROM等であり、画像データ等を記憶し、電源を切っても記憶内容が消えない。CPU2902は、RAM2904内のコンピュータプログラムを実行することにより、第1及び第2の実施形態の処理を行う。
The
ネットワークインタフェース2905は、ネットワークに接続するためのインタフェースである。入力装置2906は、例えばキーボード及びマウス等であり、各種指定又は入力等を行うことができる。出力装置2907は、ディスプレイ及びプリンタ等である。
The
本実施形態は、前述した実施形態の機能を実現するソフトウェアのプログラムコードを記録したコンピュータ読み取り可能な記録媒体(または記憶媒体)を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(またはCPUやMPU)が記録媒体に格納されたプログラムコードを読み出し実行することによって、達成することができる。この場合、記録媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記録した記録媒体は本発明を構成することになる。また、コンピュータが読み出したプログラムコードを実行することにより、第1及び第2の実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているオペレーティングシステム(OS)などが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。 In the present embodiment, a computer-readable recording medium (or storage medium) in which a program code of software that realizes the functions of the above-described embodiments is recorded is supplied to the system or apparatus, and the computer (or CPU) of the system or apparatus is supplied. Or MPU) can read out and execute the program code stored in the recording medium. In this case, the program code itself read from the recording medium realizes the functions of the above-described embodiment, and the recording medium on which the program code is recorded constitutes the present invention. In addition, by executing the program code read by the computer, not only the functions of the first and second embodiments are realized, but also an operating system running on the computer based on an instruction of the program code ( It goes without saying that the case where the functions of the above-described embodiments are realized by performing part or all of the actual processing by the OS) or the like.
さらに、記録媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張カードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって前述した実施形態の機能が実現される場合も含まれることは言うまでもない。 Further, after the program code read from the recording medium is written in a memory provided in a function expansion card inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that the CPU or the like provided in the card or the function expansion unit performs part or all of the actual processing, and the functions of the above-described embodiments are realized by the processing.
本実施形態を上記記録媒体に適用する場合、その記録媒体には、先に説明したフローチャートに対応するプログラムコードが格納されることになる。 When the present embodiment is applied to the recording medium, program code corresponding to the flowchart described above is stored in the recording medium.
尚、本実施形態は、複数の機器(例えば、ホストコンピュータ、インタフェース機器、リーダ、プリンタ等)から構成されるシステムに適用しても、一つの機器からなる装置(例えば、複写機、ファクシミリ装置等)に適用してもよい。 Note that the present embodiment can be applied to a system composed of a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), but a device (for example, a copier, a facsimile machine, etc.) composed of a single device. ).
以上説明したように、第1〜第3の実施形態によれば、あらかじめ背景画像を用意するような構成を採らなくても、連続して入力するフレームの中から背景画像と任意形状画像を選択し、分離・合成することにより、シーンに限定されない汎用的な高能率符号化システムを実現することができる。 As described above, according to the first to third embodiments, it is possible to select a background image and an arbitrary shape image from continuously input frames without adopting a configuration in which a background image is prepared in advance. However, by separating and synthesizing, a general-purpose high-efficiency encoding system that is not limited to a scene can be realized.
画像内の被写体の有無に関わらず背景画像とするフレームを選択することができるので、背景画像を設定するための事前処理が必要なくなる。また、矩形画像符号化手段を必要とせず、任意形状画像符号化手段のみで符号化することができる。また、背景データを補正することにより、動画像のノイズや微小変動による影響を抑制でき、復号後の合成画像においても、より自然な画像を得ることができる。 Since a frame as a background image can be selected regardless of the presence or absence of a subject in the image, pre-processing for setting the background image is not necessary. Further, the rectangular image encoding means is not required, and the encoding can be performed only by the arbitrary shape image encoding means. Further, by correcting the background data, it is possible to suppress the influence of moving image noise and minute fluctuations, and it is possible to obtain a more natural image even in a composite image after decoding.
なお、上記実施形態は、何れも本発明を実施するにあたっての具体化の例を示したものに過ぎず、これらによって本発明の技術的範囲が限定的に解釈されてはならないものである。すなわち、本発明はその技術思想、またはその主要な特徴から逸脱することなく、様々な形で実施することができる。 The above-described embodiments are merely examples of implementation in carrying out the present invention, and the technical scope of the present invention should not be construed in a limited manner. That is, the present invention can be implemented in various forms without departing from the technical idea or the main features thereof.
101 画像選択部
103 形状データ生成部
104 背景データ補正部
105 形状データ生成・補正部
2101 画像入力部
2105 任意形状画像符号化部
2106 多重化部
2901 バス
2902 CPU
2903 ROM
2904 RAM
2905 ネットワークインタフェース
2906 入力装置
2907 出力装置
2908 外部記憶装置
101
2903 ROM
2904 RAM
2905
Claims (12)
前記動画像の中から背景画像とするフレームを選択する際に、画像内の被写体の有無に関わらず背景画像とするフレームを選択する画像選択手段と、
前記背景画像とするフレームと前記入力画像のフレームとを比較し、その差分値を基に形状データを生成する形状データ生成手段と、
前記形状データを基に前記背景画像を補正する背景データ補正手段と、
前記入力画像を前記形状データと共に任意形状画像として符号化する任意形状画像符号化手段と
を有することを特徴とする画像処理装置。 A moving image input means for inputting a moving image composed of a plurality of frames;
When selecting a frame as a background image from the moving image, an image selection means for selecting a frame as a background image regardless of the presence or absence of a subject in the image;
A shape data generating means for comparing the frame as the background image with the frame of the input image and generating shape data based on the difference value;
Background data correction means for correcting the background image based on the shape data;
An image processing apparatus comprising: an arbitrary shape image encoding means for encoding the input image as an arbitrary shape image together with the shape data.
前記動画像の中から背景画像とするフレームを選択する際に、画像内の被写体の有無に関わらず背景画像とするフレームを選択する画像選択ステップと、
前記背景画像とするフレームと前記入力画像のフレームとを比較し、その差分値を基に形状データを生成する形状データ生成ステップと、
前記形状データを基に前記背景画像を補正する背景データ補正ステップと、
前記入力画像を前記形状データと共に任意形状画像として符号化する任意形状画像符号化ステップと
を有することを特徴とする画像処理方法。 A moving image input step for inputting a moving image composed of a plurality of frames;
An image selection step of selecting a frame as a background image regardless of the presence or absence of a subject in the image when selecting a frame as a background image from the moving image;
A shape data generation step of comparing the frame as the background image with the frame of the input image and generating shape data based on the difference value;
A background data correction step for correcting the background image based on the shape data;
An image processing method comprising: an arbitrary shape image encoding step for encoding the input image as an arbitrary shape image together with the shape data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004118231A JP2005303738A (en) | 2004-04-13 | 2004-04-13 | Image processing apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2004118231A JP2005303738A (en) | 2004-04-13 | 2004-04-13 | Image processing apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2005303738A true JP2005303738A (en) | 2005-10-27 |
Family
ID=35334736
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2004118231A Pending JP2005303738A (en) | 2004-04-13 | 2004-04-13 | Image processing apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2005303738A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011526460A (en) * | 2008-06-25 | 2011-10-06 | クゥアルコム・インコーポレイテッド | Fragmentation reference with temporal compression for video coding |
US8948270B2 (en) | 2008-08-19 | 2015-02-03 | Qualcomm Incorporated | Power and computational load management techniques in video processing |
US8948822B2 (en) | 2008-04-23 | 2015-02-03 | Qualcomm Incorporated | Coordinating power management functions in a multi-media device |
US8964828B2 (en) | 2008-08-19 | 2015-02-24 | Qualcomm Incorporated | Power and computational load management techniques in video processing |
-
2004
- 2004-04-13 JP JP2004118231A patent/JP2005303738A/en active Pending
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8948822B2 (en) | 2008-04-23 | 2015-02-03 | Qualcomm Incorporated | Coordinating power management functions in a multi-media device |
JP2011526460A (en) * | 2008-06-25 | 2011-10-06 | クゥアルコム・インコーポレイテッド | Fragmentation reference with temporal compression for video coding |
US8908763B2 (en) | 2008-06-25 | 2014-12-09 | Qualcomm Incorporated | Fragmented reference in temporal compression for video coding |
US8948270B2 (en) | 2008-08-19 | 2015-02-03 | Qualcomm Incorporated | Power and computational load management techniques in video processing |
US8964828B2 (en) | 2008-08-19 | 2015-02-24 | Qualcomm Incorporated | Power and computational load management techniques in video processing |
US9462326B2 (en) | 2008-08-19 | 2016-10-04 | Qualcomm Incorporated | Power and computational load management techniques in video processing |
US9565467B2 (en) | 2008-08-19 | 2017-02-07 | Qualcomm Incorporated | Power and computational load management techniques in video processing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108012155B (en) | Video coding method and video decoding method of pre-spliced image and related devices | |
JP4114885B2 (en) | Image encoding apparatus, method, and program | |
US20140341549A1 (en) | Image coding apparatus, image coding method, image decoding apparatus, image decoding method, and storage medium | |
US20090103630A1 (en) | Image processing device | |
WO2010095471A1 (en) | Multi-view image coding method, multi-view image decoding method, multi-view image coding device, multi-view image decoding device, multi-view image coding program, and multi-view image decoding program | |
KR101906614B1 (en) | Video decoding using motion compensated example-based super resolution | |
JP2001285871A (en) | Method and device for encoding and processing video image | |
KR20010072074A (en) | Encoding a video signal | |
JP5137687B2 (en) | Decoding device, decoding method, and program | |
JP2007122232A (en) | Image processor and program | |
JP2006279917A (en) | Dynamic image encoding device, dynamic image decoding device and dynamic image transmitting system | |
US8165217B2 (en) | Image decoding apparatus and method for decoding prediction encoded image data | |
EP2048889A2 (en) | Method and system for processing B pictures with missing or invalid forward reference pictures | |
JP2009284208A (en) | Moving image encoder and moving image recorder | |
JP2006203598A (en) | Digital image decoder and decoding method | |
JP2005303738A (en) | Image processing apparatus | |
CN100591126C (en) | Manipulating sub-pictures of a compressed video signal | |
JP4829867B2 (en) | Image encoding apparatus and image decoding apparatus | |
KR101076272B1 (en) | Method for extracting region of interest based on pixel domain for distributed video coding and computer readable medium thereof | |
JP4235209B2 (en) | Motion vector detection apparatus and motion vector detection method | |
JP2009218965A (en) | Image processor, imaging device mounted with the same and image reproduction device | |
JP2005303739A (en) | Image processing apparatus | |
JP2005122571A (en) | Image processor, image processing method, program and storage medium | |
JP2011129979A (en) | Image processor | |
JP2005167601A (en) | Image processor, image processing method, program, and recording medium |