JP2004260415A - Method for encoding image and method for decoding image - Google Patents

Method for encoding image and method for decoding image Download PDF

Info

Publication number
JP2004260415A
JP2004260415A JP2003047414A JP2003047414A JP2004260415A JP 2004260415 A JP2004260415 A JP 2004260415A JP 2003047414 A JP2003047414 A JP 2003047414A JP 2003047414 A JP2003047414 A JP 2003047414A JP 2004260415 A JP2004260415 A JP 2004260415A
Authority
JP
Japan
Prior art keywords
image
data
color
encoding
edge
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
Application number
JP2003047414A
Other languages
Japanese (ja)
Inventor
Toshiaki Mori
敏昭 森
Takashi Kuwabara
崇 桑原
Susumu Ibaraki
晋 茨木
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP2003047414A priority Critical patent/JP2004260415A/en
Publication of JP2004260415A publication Critical patent/JP2004260415A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)
  • Color Television Systems (AREA)
  • Color Image Communication Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a method and device for encoding an image and a method and device for decoding the image which can improve image quality which is deteriorated due to changes of colors at the time of irreversible compression type compression encoding. <P>SOLUTION: The image encoding method is provided with: a step (step S41) for generating edge information data showing edge strength from an input image; a step (step S42) for generating color data showing the colors of the input image; a step (step S43) for generating compressed image data by encoding the input image by compression; a step (step S44) for generating stream data from the compressed image data, the color data and the edge information data; and a step (step S45) for transmitting the stream data. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、非可逆圧縮した画像の画質を向上させるための画像符号化方法、画像復号化方法、画像符号化装置、および画像復号化装置などに関する。
【0002】
【従来の技術】
従来、車両の運転席に搭載されるカーナビゲーションシステムなどからの画像情報を後部座席のディスプレイで表示する場合は、アナログ映像信号を伝送している。近年、MOST(Media Oriented System Transport)などのデジタルネットワークが車両に搭載されるようになり、そのようなネットワークが搭載された車では、ネットワークを介して画像情報が伝送される。
【0003】
このようなネットワークを介して画像情報の伝送を行う場合、JPEG(Joint Photographic Experts Group)規格やMPEG(Moving Picture Experts Group)規格などに基づいて画像情報を非可逆圧縮方式で圧縮することで、伝送される画像情報を減少させて狭帯域のネットワークでも伝送できるようにしている。
【0004】
このような非可逆圧縮方式により画像を圧縮する画像符号化装置、および圧縮された画像を復号化する画像復号化装置についての従来例を説明する(特許文献1参照)。
【0005】
図6は、従来の画像符号化装置および画像復号化装置の構成を示すブロック図である。
図6において、画像符号化装置100は、画像入力部101と、画像統計解析部102と、前処理フィルタ係数選択部103と、前処理フィルタ処理部104と、JPEG画像圧縮部105と、情報エンコード部106と、送信部107とから構成される。一方、画像復号化装置120は、受信部110と、情報デコード部111と、JPEG画像伸長部112と、後処理フィルタ係数選択部113と後処理フィルタ処理部114と、画像出力部115とから構成される。
【0006】
画像符号化装置100において、画像統計解析部102は、画像入力部101から入力された原画像の統計的性質を解析する。前処理フィルタ係数選択部103は、事前に保持しているフィルタ係数の中から、上記統計的性質を基に適切なフィルタ係数を選択し、前処理フィルタ処理部104は、選択されたフィルタ係数を基に原画像に対してフィルタ処理を行う。
【0007】
JPEG画像圧縮部105は、原画像をJPEG方式で圧縮(符号化)した圧縮画像データを作成する。情報エンコード部106は、原画像の統計的性質と圧縮画像データを多重化し、伝送データを作成する。送信部107は、情報エンコード部106より得られた伝送データを画像復号化装置120に送信する。
【0008】
画像復号化装置120の受信部110は、上記送信部107から送信された伝送データを情報デコード部111に伝送する。情報デコード部111は、その伝送データを分離して、上記原画像の統計的性質を後処理フィルタ係数選択部113に出力し、圧縮画像データをJPEG画像伸長部112に出力する。
【0009】
JPEG画像伸長部112は、圧縮画像データを伸長(復号化)して伸長画像データを作成し、後処理フィルタ処理部114に出力する。後処理フィルタ係数選択部113は、情報デコード部111より得た原画像の統計的性質に基づき、事前に保持しているフィルタ係数の中から、適切なフィルタ係数を選択する。後処理フィルタ処理部114は、後処理フィルタ係数選択部113が選択したフィルタ係数に基づいて、JPEG画像伸長部112が出力する上記伸長画像データに対してフィルタ処理を行う。画像出力部115は、そのフィルタ処理の行われた画像データを出力する。
【0010】
このように、画像符号化装置100および画像復号化装置120では、非可逆画像圧縮を用いる際に、その圧縮前にフィルタ処理を行うことで、画質への影響が少ない信号成分をあらかじめ減らし、符号化効率を向上させることができるとともに、非可逆圧縮により雑音を発生しやすい信号成分をあらかじめ減らすことで画質を改善することができ、さらに画像データの伸長(復号)後に原画像の性質と異なる信号を減らすことで、画質を改善することができる。
【0011】
【特許文献1】
特開2002−209209号公報(全文)
【0012】
【発明が解決しようとする課題】
しかしながら、この従来の画像符号化装置および画像復号化装置においては、非可逆画像圧縮時のフィルタ処理により、復号化された画像の画質を改善しているが、JPEG圧縮やMPEG圧縮などの非可逆画像圧縮により生じてしまう原画像の色の変化を復元することはできない。特にグラフィック画像のように色調が明確である画像では、色の変化が目立つという問題がある。
【0013】
そこで本発明は、上記の課題を解決するためになされたものであり、非可逆圧縮方式による圧縮符号化時に色が変化して劣化した画質を向上することのできる画像符号化方法、画像復号化方法、画像符号化装置、および画像復号化装置などを提供することを目的とする。
【0014】
【課題を解決するための手段】
上記目的を達成するために、本発明に係る画像符号化方法は、入力画像を圧縮符号化して圧縮画像データを生成する符号化ステップと、前記圧縮符号化前の入力画像の色を示す色データを生成する色データ生成ステップと、前記圧縮画像データと前記色データからストリームデータを生成するストリーム生成ステップとを含むことを特徴とする。
【0015】
これによって、ストリームデータに入力画像の圧縮符号化前の色を示す色データが含まれるため、圧縮符号化した圧縮画像データを復号化するときに、その色データに基づいて、圧縮符号化前の色に対応するように補正することが可能となる。そのため、圧縮符号化時に色が変化して劣化した画質が向上する。特に、グラフィック画像のように色調がはっきりとしている画像の場合に色の変化が目立つため、本発明により得られる効果は大きい。
【0016】
また、前記色データ生成ステップでは、前記各画素に対応する色情報値のうち、異なる画素における同じ値の色情報値を1つのデータとする色データを生成するようにしてもよい。
【0017】
これによって、色データに使用するメモリ量を少なくすることができる。
また、圧縮符号化前の前記入力画像のエッジ強度を検出し、前記入力画像の圧縮符号化前のエッジ強度を示すエッジ情報データを生成するエッジ情報生成ステップを含み、前記ストリーム生成ステップでは、前記圧縮画像データと前記色データと前記エッジ情報データとからストリームデータを生成するようにしてもよい。
【0018】
これによって、圧縮符号化した圧縮画像データを復号化するときに、そのエッジ情報データに基づいて、圧縮符号化前の画像のエッジ強度に対応するように補正することが可能となり、圧縮符号化時に変化して劣化した画質が向上する。
【0019】
また、本発明の画像復号化方法は、入力されたストリームデータから、圧縮符号化された画像の圧縮画像データ、および前記画像における圧縮符号化前の色を示す色データを抽出する抽出ステップと、前記圧縮画像データを伸長復号化して伸長画像データを生成する復号化ステップと、前記伸長画像データの色を前記色データに基づいて変換する変換ステップとを含むことを特徴とする。
【0020】
これによって、復号化後の画像を色データに基づいて圧縮符号化前の色に対応するように補正することが可能となる。そのため、圧縮符号化時に色が変化して劣化した画質が向上する。特に、グラフィック画像のように色調がはっきりとしている画像の場合に色の変化が目立つため、本発明により得られる効果は大きい。
【0021】
また、前記抽出ステップでは、さらに前記入力されたストリームデータから前記圧縮符号化前の画像のエッジ強度を示すエッジ情報データを抽出し、当該画像復号化方法はさらに、前記エッジ情報データに基づいて、前記伸長画像データを補正する補正ステップを含むようにしてもよい。
【0022】
これにより、エッジ情報データに基づいて、復号化後の画像を圧縮符号化前の画像のエッジ強度に対応するように補正することが可能となり、圧縮符号化時に変化して劣化した画質が向上する。
【0023】
なお、本発明は、このような画像符号化方法および画像復号化方法として実現することができるだけでなく、このような画像符号化方法および画像復号化方法に含まれる特徴的なステップを手段とする画像符号化装置および画像復号化装置として実現したり、それらのステップをコンピュータに実行させるプログラムとして実現したりすることもできる。そして、そのようなプログラムは、CD−ROMなどの記録媒体やインターネットなどの伝送媒体を介して配信することができるのは言うまでもない。さらに本発明は、上記画像符号化方法に含まれる各ステップにより生成されたデータを備えるストリームデータが記録された記録媒体として実現してもよい。
【0024】
【発明の実施の形態】
以下、本発明の実施の形態について説明する。
図1は、本発明の実施の形態における画像符号化方法および画像復号化方法を実現するための画像符号化装置および画像復号化装置の構成を示すブロック図である。
【0025】
図1において、画像符号化装置1は、画像入力部11と、画像圧縮部12と、エッジ情報生成部13と、色デーブル生成部14と、情報多重化部15と、送信部16により構成され、入力された画像データの符号化を行う。
【0026】
画像入力部11は、符号化を行う画像データを入力し、画像圧縮部12、エッジ情報生成部13、および色テーブル生成部14に画像データを出力する。
画像圧縮部12は、画像入力部11から出力される画像データをJPEG規格に基づく方法で圧縮(符号化)して(以後JPEG圧縮と呼ぶ)圧縮画像データを生成する。
【0027】
エッジ情報生成部13は、画像入力部11から出力される画像データのエッジ強度を検出し、検出したエッジ強度を基にエッジ情報データを生成する。
色テーブル生成部14は、画像入力部11から出力される画像データにおける全画素の色情報値である色成分値を抽出し、その色成分値を基に色データである色テーブルデータを生成する。
【0028】
情報多重化部15は、上記圧縮画像データ、エッジ情報データ、および色テーブルデータを多重化して、1つのストリームデータを生成する。
送信部16は、情報多重化部15が生成したストリームデータを画像復号化装置2に送信する。
【0029】
一方、画像復号化装置2は、受信部21と、情報分離部22と、エッジ情報保存部23と、色テーブル保存部24と、画像伸長部25と、フィルタ部26と、色変換部27と、画像出力部28とにより構成され、画像符号化装置1が符号化して生成したストリームデータを復号化する。
【0030】
受信部21は、画像符号化装置1が送信したストリームデータを受信し、情報分離部22に出力する。
情報分離部22は、受信部21が出力するストリームデータから圧縮画像データ、エッジ情報データ、および色テーブルデータを分離して抽出し、圧縮画像データを画像伸長部25に、エッジ情報データをエッジ情報保存部23に、色テーブルデータを色テーブル保存部24に出力する。
【0031】
エッジ情報保存部23は、エッジ情報データを保持する。
色テーブル保存部24は、色テーブルデータを保持する。
画像伸長部25は、圧縮画像データを伸長(復号化)して、伸長画像データをフィルタ部26に出力する。
【0032】
フィルタ部26は、エッジ情報保存部23が保持しているエッジ情報データに基づいて、上記伸長画像データのフィルタリングを行い、フィルタリングされた画像データを色変換部27に出力する。
【0033】
色変換部27は、色テーブル保存部24が保持している色テーブルデータに基づいて、上記フィルタリングされた画像データの画素値を変換し、画像出力部28に出力する。
【0034】
画像出力部28は、色変換部27から出力された画像データを表示する。
このように構成された画像符号化装置1と画像復号化装置2の動作を説明する。
【0035】
図2は、画像符号化装置1の動作を示すフローチャートである。
まず、エッジ情報生成部13は、画像入力部11から出力される画像データからエッジ情報データを生成する(ステップS41)。
【0036】
ここで、エッジ情報生成部13が行う動作の詳細を説明する。
エッジ情報生成部13は、入力した画像データの8×8画素のブロック毎にそれぞれエッジ強度を求める。
【0037】
このとき、エッジ情報生成部13は、濃淡の変化が急峻であるかを検出することで、各ブロックのエッジ強度を検出する。
エッジ情報生成部13は、この検出したエッジ強度が予め定めた閾値以上であれば、そのエッジを強調するため、後述する画像復号化装置2で復号化した画像におけるその対応するブロックの画像データにエッジ強調フィルタをかけることを示す情報(例えば0,1の2値で示した場合は1)をエッジ情報データとして生成し、またエッジ強度が閾値未満のときはそのブロックにエッジがないとして、後述する画像復号化装置2で復号化した画像におけるその対応するブロックの画像データにローパスフィルタをかけることを示す情報(例えば0,1の2値で示した場合は0)をエッジ情報データとして生成する。このように、エッジ情報生成部13は、復号化後の画像に行うフィルタリング方法をブロック毎に対応させた情報を生成する。
【0038】
次に、色テーブル生成部14は、画像入力部11から出力される画像データを基に、後に復号化される画像データの色補正を行うために用いる色テーブルデータを生成する(ステップS42)。
【0039】
ここで、色テーブル生成部14が行う動作を説明する。
図3(a)は、色テーブル生成部14が生成する色テーブルデータを示した図であり、図3(b)は画像の各画素を示した図である。
【0040】
図3(a)において、色テーブルデータ40は、RGB値におけるR値、G値、B値からなる組を複数組有している。
色テーブル生成部14は、画像入力部11から出力される画像50における各画素の色情報値であるRGB値を順番に読み出し、その読み出したRGB値を書き込み、色テーブルデータ40を生成する。画像の各画素は、例えば輝度信号と色差信号により示されており、その信号よりRGB値を得る(読み出す)ことができる。
【0041】
例えば、色テーブル生成部14が、図3(b)に示す画像50の画素50aのRGB値を読み出し、そのRGB値がR値=43、G値=56、B値=18である場合、図3(a)に示す色テーブルデータ40にRGB値40a(R値=43、G値=56、B値=18)を書き込む。
【0042】
同様に、色テーブル生成部14が画像50の画素50bのRGB値を読み出し、そのRGB値がR値=79、G値=94、B値=146である場合、色テーブルデータ40にRGB値の組としてRGB値40bを書き込む。
【0043】
このように、色テーブル生成部14は、画像50の全画素のRGB値を順番に読み出し、色テーブルデータ40にRGB値の組を書き込む。このとき、画像50から読み出したRGB値の組がすでに色テーブルデータ40に書き込まれている場合は、再度書き込むことはしない。すなわち、異なる画素における同じ値のRGB値を1つのデータとする。
【0044】
例えば、画像50の画素50cのRGB値が、画素50bのRGB値と同じくR値=79、G値=94、B値=146である場合、すでに色テーブルデータ40にRGB値40bが書き込まれているため、画素50cについてはRGB値を書き込むことはしない。
【0045】
以上のように、色テーブル生成部14は、色テーブルデータ40を生成する。次に、画像圧縮部12は、画像入力部11が出力する画像データをJPEG圧縮(符号化)し、圧縮画像データを生成する(ステップS43)。
【0046】
次に、情報多重化部15は、エッジ情報生成部13が生成したエッジ情報データと、色テーブル生成部14が生成した色テーブルデータと、画像圧縮部12が生成した圧縮画像データとを多重化して、1つのストリームデータを生成する(ステップS44)。
【0047】
送信部16は、情報多重化部15が生成したストリームデータを画像復号化装置2に送信する(ステップS45)。
図5は、ストリームデータの構造を示す模式図である。
【0048】
図5に示されるように、ストリームデータ60は、エッジ情報ヘッダ61と、エッジ情報データ62と、色テーブルヘッダ63と、色テーブルデータ64と、圧縮画像ヘッダ65と、圧縮画像データ66により構成される。
【0049】
エッジ情報ヘッダ61は、エッジ情報ヘッダ固有のIDデータと、エッジ情報データ62のデータ長を示すデータとで構成される。
色テーブルヘッダ63は、色テーブルヘッダ固有のIDデータと、色テーブルデータ64のデータ長を示すデータとで構成される。
【0050】
圧縮画像ヘッダ65は、圧縮画像ヘッダ固有のIDデータと、圧縮画像データ66のデータ長を示すデータとで構成される。
エッジ情報データ62、色テーブルデータ64、圧縮画像データ66は、それぞれエッジ情報生成部13、色テーブル生成部14、画像圧縮部12が生成したデータである。
【0051】
次に、上述のストリームデータを復号化する画像復号化装置2の動作について説明する。
図4は、画像復号化装置2の動作を示すフローチャートである。
【0052】
まず、受信部21は、画像符号化装置1が送信したストリームデータを受信する(ステップS51)。
次に、情報分離部22は、受信部21が受信したストリームデータから圧縮画像データと、エッジ情報データと、色テーブルデータとを分離して抽出し、圧縮画像データを画像伸長部25に出力し、エッジ情報データをエッジ情報保存部23に出力し、色テーブルデータを色テーブル保存部24に出力する(ステップS52)。
【0053】
次に画像伸長部25は、JPEG圧縮された圧縮画像データを伸長(復号化)し、伸長画像データを生成する(ステップS53)。
次にフィルタ部26は、対応するエッジ情報データの値を基に、各ブロックの伸長画像データにフィルタリングし、フィルタ画像データを生成する(ステップS54)。
【0054】
ここで、フィルタ部26が行うフィルタリングの詳細を説明する。
まず、フィルタ部26は、フィルタリングを行う画像の各ブロック(8×8画素)に対応するエッジ情報データの値(0か1)をエッジ情報保存部23から読み出す。
【0055】
上述したようにエッジ情報データは、画像符号化装置1での符号化前に、ブロックにおけるエッジ強度が所定の閾値以上である場合は、そのエッジを強調するためにそのブロックの復号化(伸長)後の画像データにエッジ強調フィルタをかけることを示す情報(例えば0,1の2値で示した場合は1)を記憶し、また符号化前にエッジ強度が閾値未満のときはそのブロックにエッジがないとして、そのブロックの復号化(伸長)後の画像データにローパスフィルタをかけることを示す情報(例えば0,1の2値で示した場合は0)を記憶したデータである。
【0056】
フィルタ部26は、各ブロックに対応するエッジ情報データの値が1である場合は、そのブロックの伸長画像データに、エッジを強調するエッジ強調フィルタをかけるフィルタリングを行い補正する。このエッジを強調するフィルタリング処理として、例えばこのブロックの画像データに高域成分を追加するようにする。
【0057】
一方、各ブロックに対応するエッジ情報データの値が0である場合、フィルタ部26は、そのブロックの伸長画像データに、ローパスフィルタをかけるフィルタリング処理をして補正する。
【0058】
このように、画像の全ブロックにおいて、上述のフィルタリング処理を行う。
以上のように、画像符号化装置1による符号化(圧縮)前の原画像の画像データにおけるエッジ強度に基づいて、原画像に対応するように復号化(伸長)後の画像データにフィルタリング処理を行う。このために、画像を符号化(圧縮)したときにエッジ付近や平坦な部分に生じたノイズを緩和することができる。
【0059】
次に、色変換部27は、色テーブル保存部24に保存されている色テーブルデータに基づき、フィルタ部26が生成したフィルタ画像データの各画素の画素値を変換して色の補正を行い、変換画像データ(復号画像データ)を生成する(ステップS55)。
【0060】
ここで色変換部27が行う動作の詳細を説明する。
色変換部27は、フィルタ部26が生成したフィルタ画像データの全画素のRGB値を順に読み出す。
【0061】
例えば、図3(b)に示される画像50が画像符号化装置1で符号化(圧縮)され、そして画像復号化装置2の画像伸長部25で復号化され、フィルタ部26から出力されたとする。そして、圧縮(符号化)したときに、画像50の画素50aのRGB値が、符号化前のRGB値(R値=43、G値=56、B値=18)からRGB値(R値=44、G値=57、B値=18)に変化したとする。
【0062】
色変換部27は、画像50における画素50aのRGB値として、R値=44、G値=57、B値=18をフィルタ部26から得る。そして、色変換部27は、この得られたRGB値が、色テーブル保存部24に保存されている色テーブルデータ40におけるRGB値の組のいずれに近い値であるかを演算し、一番近い値のRGB値の組を選択する。
【0063】
このRGB値の選択方法として、フィルタ部26から出力された画像のR値、G値、B値のそれぞれと、色テーブルデータ40に保存されているRGB値の組のR値、G値、B値のそれぞれとの差の自乗和が最も小さくなる(距離が最も近い)ものを、色テーブルデータ40に保存されているRGB値の組の中から選択する。
【0064】
例えば、この場合、RGB値40aを選択した場合における自乗和は(44−43)+(57−56)+(18−18)=2であり、RGB値40bを選択した場合における自乗和は(79−44)+(94−57)+(146−18)=18978である。色変換部27は、色テーブルデータ40に保持されている全てのRGB値の組からこのように演算される自乗和の一番小さいものを選択する。
【0065】
このように、色変換部27は画素50aにおける復号化後のRGB値と近い値のRGB値を選択することで、色テーブルデータ40に保存されているRGB値の組の中から、同じ画素50aにおける符号化前のRGB値40aを選択することとなる。画像の圧縮(符号化)による色の変化は大きくなるものではないため、上述のように近い値のRGBを選択することで、符号化前と同じ画素のRGB値を選択することができる。
【0066】
そして、色変換部27は、フィルタ部26より得た画像50の画素50aのRGB値(R値=44、G値=57、B値=18)を、色テーブルデータ40から選択したRGB値(R値=43、G値=56、B値=18)、すなわち符号化前のRGB値に変換する。
【0067】
またこのとき、画像50の画素50cにおける符号化前のRGB値はRGB値40aであり、上述と同様に画素50cの復号化後のRGB値と近い値のRGB値を色テーブルデータ40から選択することで、RGB値40aが選択される。このように異なる画素50a,50cにおける同一値のRGB値を1つのテーブルデータ(RGB値40a)とすることで、色テーブルデータ40に使用するメモリ量を少なくすることができる。
【0068】
そして上述のような変換を画像の全画素において行い、変換画像データを生成する。
以上のようにして、色変換部27が符号化前のRGB値に変換することで、画像の圧縮時(符号化時)に色が変化して劣化した画質が向上する。
【0069】
次に、画像出力部28は変換画像データ(復号画像データ)を基に復号画像を表示して(ステップS56)、処理を終了する。
以上のように本実施の形態によれば、復号化後の画像の色を符号化前の原画像の色に変換することで、JPEG圧縮時に色が変化して劣化した画質が向上する。特に、グラフィック画像のように色調がはっきりとしている画像の場合は圧縮による色の変化が目立つため有効である。
【0070】
また、本実施の形態では、ある画素における復号化後のRGB値と近い値のRGB値を色テーブルデータ40の中から選択することで、同じ画素の符号化前のRGB値を特定して得るようにしているため、色テーブルデータ40は、各RGB値がいずれの画素に対応するものであるかを示す画素情報を有していない構成である。そのため、色テーブルデータ40はその画素情報の分だけ使用するメモリが少ないという利点がある。
【0071】
尚、色テーブルデータ40は、各RGB値がいずれの画素に対応するかを示す上述した画素情報を有するデータであってもよい。例えば、図3(a)に示す色テーブルデータ40のRGB値40a(R値=43、G値=56、B値=18)が画素50aにおけるデータであることを示す画素情報を色テーブルデータ40が有するようにしてもよい。そして、画像復号化装置2において、色変換部27は、復号化後のある画素のRGB値を、画素情報を基に色データテーブル40における同一画素のRGB値に変換するようにすればよい。
【0072】
また、本実施の形態では、画像符号化装置1では、エッジ情報生成部13が画像のブロック毎にエッジ強度を検出し、画像復号化装置2では、エッジ情報保存部23が上記エッジ強度を保存し、フィルタ部26がその保存されたエッジ強度に基づいて画像信号のフィルタリングを行うようにしたが、エッジ情報生成部13およびエッジ情報保存部23を設けないようにし、エッジ強度を検出することなく、フィルタ部26が予め定められた方法でフィルタリングを行うようにしてもよい。
【0073】
また、フィルタ部26が画像伸長部25から出力される伸長画像を解析して、その解析結果に応じて、フィルタリング方法を適応的に決めてもよい。
また、画像符号化装置1が送信し、画像復号化装置2が受信するストリームデータ60のフォーマットの一例を図5に示したが、エッジ情報ヘッダ61やエッジ情報データ62などの各データ領域の順番は、図5に示す順番とは異なるものであってもよい。さらに、エッジ情報データ62と色テーブルデータ64のデータ長を固定長にし、エッジ情報ヘッダ61と色テーブルヘッダ63を無くしてもよい。さらにまた、ストリームデータ60中に他のデータが含まれるようにしてもよい。
【0074】
そしてまた、図3(b)に示される1つの画像50につき、色テーブルデータとして図3(a)に示される1つの色テーブルデータ40を設定したが、画像50を複数の領域に分割し、分割した各領域に1つの色テーブルデータを設定するようにしてもよい。また、複数の画像に対して1つの色テーブルデータを設定するようにしてもよい。さらに、色テーブルデータ40に書き込む値をRGB値としたが、色を示す値として輝度と色差の組み合わせなど他の値を用いてもよい。
【0075】
また色変換部27は、フィルタ部26から出力されるRGB値を色テーブルデータ40に含まれるRGB値のうち、差の自乗和(距離)が最も小さくなるRGB値に変換するようにしたが、符号化前の同じ画素のRGB値に変換するようにすれば、この方法に限定されない。また、フィルタ部26から出力されるある画素値は、色テーブルデータ40の各RGB値との距離を求めた結果に応じて、変換しないようにしてもよい。
【0076】
そしてまたエッジ情報生成部13は、8×8画素のブロック毎におけるフィルタの種類(エッジ強調フィルタ、ローパスフィルタ)を示す情報をエッジ情報データとして生成したが、ブロックの大きさは8×8画素に限定されず、1×8画素などのラインであってもよい。また、フィルタの種類は、エッジ強調フィルタやローパスフィルタ以外であってもよく、またエッジ情報データにフィルタ係数やフィルタをかける方向など、フィルタの種類以外の情報を書き込むようにしてもよい。さらに、エッジ情報データとして、ブロック毎のエッジ強度を示す値を書き込むようにしてもよく、エッジ画像をエッジ情報データとしてもよい。
【0077】
また、画像伸長部25で伸長した伸長画像データにフィルタ処理を施すようにしたが、画像伸長部25内で圧縮画像データに含まれる周波数係数にフィルタをかけるようにしてもよい。
【0078】
さらに、画像符号化装置1の画像入力部11が出力した画像データに対してフィルタリングや減色処理などの前処理を行うようにしてもよい。
また、画像符号化装置1内に画像復号化装置2と同等の復号化機能を備えて、画像符号化装置1で符号化し復号化して生成した画像を基に、再度符号化を行うようにしてもよい。
【0079】
そしてまた、画像符号化装置1は、情報多重化部15が生成したストリームデータを記録媒体に記録してもよい。また、画像復号化装置2は、記録媒体からストリームデータを入力するようにしてもよい。
【0080】
さらに、画像の非可逆圧縮方式としてJPEG圧縮を用いて説明したが、MPEG圧縮などの他の非可逆圧縮方式であってもよい。
【0081】
【発明の効果】
以上の説明から明らかなように、本発明によれば、復号化後の画像を色データに基づいて圧縮符号化前の色に対応するように補正することが可能となる。そのため、圧縮符号化時に色が変化して劣化した画質が向上する。特に、グラフィック画像のように色調がはっきりとしている画像の場合に色の変化が目立つため有効である。
【図面の簡単な説明】
【図1】本発明の実施の形態に係る画像符号化方法と画像復号化方法を実現する画像符号化装置と画像復号化装置の構成を示すブロック図である。
【図2】本発明の実施の形態に係る画像符号化装置の動作を示すフローチャートである。
【図3】(a)は本発明の実施の形態に係る画像符号化装置における色テーブルデータを示すデータ図であり、(b)は符号化する画像を説明するために用いる説明図である。
【図4】本発明の実施の形態に係る画像復号化装置の動作を示すフローチャートである。
【図5】本発明の実施の形態に係る画像符号化装置より出力されるストリームデータの構造を示すデータ図である。
【図6】従来の画像符号化装置と画像復号化装置の構成を示すブロック図である。
【符号の説明】
1 画像符号化装置
2 画像復号化装置
11 画像入力部
12 画像圧縮部
13 エッジ情報生成部
14 色テーブル生成部
15 情報多重化部
16 送信部
21 受信部
22 情報分離部
23 エッジ情報保存部
24 色テーブル保存部
25 画像伸長部
26 フィルタ部
27 色変換部
28 画像出力部
40 色テーブルデータ
50 画像
60 ストリームデータ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an image encoding method, an image decoding method, an image encoding device, an image decoding device, and the like for improving the image quality of an irreversibly compressed image.
[0002]
[Prior art]
Conventionally, when displaying image information from a car navigation system mounted on a driver's seat of a vehicle on a display of a rear seat, an analog video signal is transmitted. 2. Description of the Related Art In recent years, digital networks such as MOST (Media Oriented System Transport) have been mounted on vehicles, and in vehicles equipped with such networks, image information is transmitted via the networks.
[0003]
When image information is transmitted through such a network, the image information is compressed by a lossy compression method based on the JPEG (Joint Photographic Experts Group) standard or the MPEG (Moving Picture Experts Group) standard. This reduces image information to be transmitted so that it can be transmitted even over a narrowband network.
[0004]
A conventional example of an image encoding device that compresses an image by such an irreversible compression method and an image decoding device that decodes a compressed image will be described (see Patent Document 1).
[0005]
FIG. 6 is a block diagram showing the configuration of a conventional image encoding device and image decoding device.
6, an image encoding apparatus 100 includes an image input unit 101, an image statistical analysis unit 102, a pre-processing filter coefficient selection unit 103, a pre-processing filter processing unit 104, a JPEG image compression unit 105, an information encoding It comprises a unit 106 and a transmission unit 107. On the other hand, the image decoding device 120 includes a receiving unit 110, an information decoding unit 111, a JPEG image decompression unit 112, a post-processing filter coefficient selection unit 113, a post-processing filter processing unit 114, and an image output unit 115. Is done.
[0006]
In the image encoding device 100, the image statistical analysis unit 102 analyzes the statistical properties of the original image input from the image input unit 101. The pre-processing filter coefficient selection unit 103 selects an appropriate filter coefficient from the filter coefficients stored in advance based on the statistical properties, and the pre-processing filter processing unit 104 converts the selected filter coefficient Based on this, filter processing is performed on the original image.
[0007]
The JPEG image compression unit 105 creates compressed image data obtained by compressing (encoding) the original image by the JPEG method. The information encoding unit 106 multiplexes the statistical properties of the original image and the compressed image data to create transmission data. The transmission unit 107 transmits the transmission data obtained from the information encoding unit 106 to the image decoding device 120.
[0008]
The receiving unit 110 of the image decoding device 120 transmits the transmission data transmitted from the transmitting unit 107 to the information decoding unit 111. The information decoding unit 111 separates the transmission data, outputs the statistical properties of the original image to the post-processing filter coefficient selection unit 113, and outputs the compressed image data to the JPEG image decompression unit 112.
[0009]
The JPEG image decompression unit 112 decompresses (decodes) the compressed image data to create decompressed image data, and outputs the decompressed image data to the post-processing filter processing unit 114. The post-processing filter coefficient selection unit 113 selects an appropriate filter coefficient from the filter coefficients stored in advance based on the statistical properties of the original image obtained from the information decoding unit 111. The post-processing filter processing unit 114 performs a filtering process on the decompressed image data output from the JPEG image decompression unit 112 based on the filter coefficient selected by the post-processing filter coefficient selection unit 113. The image output unit 115 outputs the image data on which the filtering process has been performed.
[0010]
As described above, in the image encoding device 100 and the image decoding device 120, when irreversible image compression is used, by performing a filter process before the compression, a signal component having little effect on image quality is reduced in advance, and the codec is reduced. Image quality can be improved by reducing in advance the signal components that are likely to generate noise due to lossy compression, and furthermore, after decompression (decoding) of image data, a signal that differs from the characteristics of the original image , The image quality can be improved.
[0011]
[Patent Document 1]
JP 2002-209209 A (full text)
[0012]
[Problems to be solved by the invention]
However, in the conventional image encoding device and the image decoding device, although the image quality of the decoded image is improved by the filtering process at the time of irreversible image compression, irreversible images such as JPEG compression and MPEG compression are used. It is not possible to restore the color change of the original image caused by the image compression. In particular, in an image having a clear color tone such as a graphic image, there is a problem that a color change is conspicuous.
[0013]
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problems, and has been made in consideration of an image encoding method and an image decoding method capable of improving a deteriorated image quality due to a change in color during compression encoding by a lossy compression method. It is an object to provide a method, an image encoding device, an image decoding device, and the like.
[0014]
[Means for Solving the Problems]
In order to achieve the above object, an image encoding method according to the present invention comprises: an encoding step of compressing and encoding an input image to generate compressed image data; and color data indicating a color of the input image before the compression encoding. , And a stream generating step of generating stream data from the compressed image data and the color data.
[0015]
Thus, since the stream data includes color data indicating the color of the input image before compression encoding, when decoding the compression-encoded compressed image data, the image data before compression encoding is decoded based on the color data. Correction can be made to correspond to the color. For this reason, the image quality deteriorates due to a change in color during compression encoding. In particular, in the case of an image having a clear color tone such as a graphic image, the color change is conspicuous, and the effect obtained by the present invention is large.
[0016]
In the color data generation step, color data may be generated in which, of the color information values corresponding to the respective pixels, the same color information value in different pixels is used as one data.
[0017]
This makes it possible to reduce the amount of memory used for color data.
Further, the method includes an edge information generation step of detecting edge strength of the input image before compression encoding and generating edge information data indicating an edge strength of the input image before compression encoding. Stream data may be generated from the compressed image data, the color data, and the edge information data.
[0018]
Accordingly, when decoding the compressed and encoded compressed image data, it is possible to correct the image data based on the edge information data so as to correspond to the edge strength of the image before the compression and encoding. The changed and deteriorated image quality is improved.
[0019]
Further, the image decoding method of the present invention, from the input stream data, an extraction step of extracting compressed image data of a compression-encoded image, and color data indicating a color of the image before compression encoding, A decoding step of decompressing and decoding the compressed image data to generate decompressed image data, and a conversion step of converting a color of the decompressed image data based on the color data.
[0020]
This makes it possible to correct the decoded image so as to correspond to the color before compression encoding based on the color data. For this reason, the image quality deteriorates due to a change in color during compression encoding. In particular, in the case of an image having a clear color tone such as a graphic image, the color change is conspicuous, and the effect obtained by the present invention is large.
[0021]
In the extracting step, edge information data indicating the edge strength of the image before the compression encoding is further extracted from the input stream data, and the image decoding method further includes, based on the edge information data, A correction step for correcting the decompressed image data may be included.
[0022]
Thereby, based on the edge information data, it is possible to correct the decoded image so as to correspond to the edge strength of the image before the compression encoding, and to improve the image quality changed and degraded during the compression encoding. .
[0023]
It should be noted that the present invention can be realized not only as such an image encoding method and an image decoding method, but also by using characteristic steps included in such an image encoding method and an image decoding method. It can also be realized as an image encoding device and an image decoding device, or as a program that causes a computer to execute those steps. Needless to say, such a program can be distributed via a recording medium such as a CD-ROM or a transmission medium such as the Internet. Further, the present invention may be realized as a recording medium on which stream data including data generated by each step included in the image encoding method is recorded.
[0024]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described.
FIG. 1 is a block diagram showing a configuration of an image encoding device and an image decoding device for realizing the image encoding method and the image decoding method according to the embodiment of the present invention.
[0025]
In FIG. 1, the image encoding device 1 includes an image input unit 11, an image compression unit 12, an edge information generation unit 13, a color table generation unit 14, an information multiplexing unit 15, and a transmission unit 16. , And encodes the input image data.
[0026]
The image input unit 11 inputs image data to be encoded, and outputs the image data to the image compression unit 12, the edge information generation unit 13, and the color table generation unit 14.
The image compression unit 12 compresses (encodes) the image data output from the image input unit 11 by a method based on the JPEG standard (hereinafter, referred to as JPEG compression) to generate compressed image data.
[0027]
The edge information generation unit 13 detects the edge strength of the image data output from the image input unit 11, and generates edge information data based on the detected edge strength.
The color table generation unit 14 extracts color component values that are color information values of all pixels in the image data output from the image input unit 11, and generates color table data that is color data based on the color component values. .
[0028]
The information multiplexing unit 15 multiplexes the compressed image data, the edge information data, and the color table data to generate one stream data.
The transmission unit 16 transmits the stream data generated by the information multiplexing unit 15 to the image decoding device 2.
[0029]
On the other hand, the image decoding device 2 includes a reception unit 21, an information separation unit 22, an edge information storage unit 23, a color table storage unit 24, an image decompression unit 25, a filter unit 26, a color conversion unit 27, , An image output unit 28, and decodes stream data generated by encoding by the image encoding device 1.
[0030]
The receiving unit 21 receives the stream data transmitted by the image encoding device 1 and outputs the stream data to the information separating unit 22.
The information separating unit 22 separates and extracts the compressed image data, the edge information data, and the color table data from the stream data output from the receiving unit 21, and outputs the compressed image data to the image decompression unit 25 and the edge information data to the edge information. The color table data is output to the storage unit 23 and the color table storage unit 24.
[0031]
The edge information storage unit 23 holds edge information data.
The color table storage unit 24 holds color table data.
The image decompression unit 25 decompresses (decodes) the compressed image data and outputs the decompressed image data to the filter unit 26.
[0032]
The filter unit 26 performs filtering on the expanded image data based on the edge information data stored in the edge information storage unit 23, and outputs the filtered image data to the color conversion unit 27.
[0033]
The color conversion unit 27 converts the pixel values of the filtered image data based on the color table data stored in the color table storage unit 24, and outputs the converted pixel values to the image output unit 28.
[0034]
The image output unit 28 displays the image data output from the color conversion unit 27.
The operation of the image encoding device 1 and the image decoding device 2 configured as described above will be described.
[0035]
FIG. 2 is a flowchart illustrating the operation of the image encoding device 1.
First, the edge information generation unit 13 generates edge information data from the image data output from the image input unit 11 (Step S41).
[0036]
Here, the operation performed by the edge information generation unit 13 will be described in detail.
The edge information generation unit 13 calculates an edge strength for each 8 × 8 pixel block of the input image data.
[0037]
At this time, the edge information generation unit 13 detects the edge intensity of each block by detecting whether the change in shading is sharp.
If the detected edge strength is equal to or greater than the predetermined threshold, the edge information generation unit 13 adds the edge data to the image data of the corresponding block in the image decoded by the image decoding device 2 described later to emphasize the edge. Information indicating that an edge emphasis filter is to be applied (for example, 1 in the case of binary values of 0 and 1) is generated as edge information data, and when the edge intensity is less than the threshold value, it is determined that the block has no edge, and will be described later. (For example, 0 in the case of binary 0, 1) indicating that a low-pass filter is to be applied to the image data of the corresponding block in the image decoded by the image decoding device 2 to generate the edge information data. . As described above, the edge information generation unit 13 generates information in which a filtering method performed on an image after decoding is associated with each block.
[0038]
Next, based on the image data output from the image input unit 11, the color table generation unit 14 generates color table data used for performing color correction on image data to be decoded later (step S42).
[0039]
Here, the operation performed by the color table generation unit 14 will be described.
FIG. 3A is a diagram illustrating color table data generated by the color table generating unit 14, and FIG. 3B is a diagram illustrating each pixel of an image.
[0040]
In FIG. 3A, the color table data 40 has a plurality of sets of R, G, and B values in RGB values.
The color table generation unit 14 sequentially reads the RGB values that are the color information values of each pixel in the image 50 output from the image input unit 11, writes the read RGB values, and generates the color table data 40. Each pixel of the image is represented by, for example, a luminance signal and a color difference signal, and an RGB value can be obtained (read) from the signal.
[0041]
For example, when the color table generation unit 14 reads the RGB values of the pixel 50a of the image 50 shown in FIG. 3B, and the RGB values are R value = 43, G value = 56, and B value = 18, FIG. An RGB value 40a (R value = 43, G value = 56, B value = 18) is written in the color table data 40 shown in FIG.
[0042]
Similarly, the color table generation unit 14 reads the RGB values of the pixel 50b of the image 50, and when the RGB values are R value = 79, G value = 94, and B value = 146, the color table data 40 The RGB value 40b is written as a set.
[0043]
As described above, the color table generation unit 14 reads the RGB values of all the pixels of the image 50 in order, and writes the set of RGB values in the color table data 40. At this time, if the set of RGB values read from the image 50 has already been written in the color table data 40, it is not written again. That is, the same RGB value in different pixels is regarded as one data.
[0044]
For example, when the RGB values of the pixel 50c of the image 50 are R value = 79, G value = 94, and B value = 146, like the RGB value of the pixel 50b, the RGB value 40b has already been written in the color table data 40. Therefore, no RGB value is written for the pixel 50c.
[0045]
As described above, the color table generation unit 14 generates the color table data 40. Next, the image compression unit 12 performs JPEG compression (encoding) on the image data output from the image input unit 11 to generate compressed image data (Step S43).
[0046]
Next, the information multiplexing unit 15 multiplexes the edge information data generated by the edge information generation unit 13, the color table data generated by the color table generation unit 14, and the compressed image data generated by the image compression unit 12. Then, one stream data is generated (step S44).
[0047]
The transmitting unit 16 transmits the stream data generated by the information multiplexing unit 15 to the image decoding device 2 (Step S45).
FIG. 5 is a schematic diagram showing the structure of stream data.
[0048]
As shown in FIG. 5, the stream data 60 includes an edge information header 61, edge information data 62, a color table header 63, a color table data 64, a compressed image header 65, and a compressed image data 66. You.
[0049]
The edge information header 61 includes ID data unique to the edge information header and data indicating the data length of the edge information data 62.
The color table header 63 includes ID data unique to the color table header and data indicating the data length of the color table data 64.
[0050]
The compressed image header 65 is composed of ID data unique to the compressed image header and data indicating the data length of the compressed image data 66.
The edge information data 62, the color table data 64, and the compressed image data 66 are data generated by the edge information generation unit 13, the color table generation unit 14, and the image compression unit 12, respectively.
[0051]
Next, the operation of the image decoding device 2 that decodes the above-described stream data will be described.
FIG. 4 is a flowchart showing the operation of the image decoding device 2.
[0052]
First, the receiving unit 21 receives the stream data transmitted by the image encoding device 1 (Step S51).
Next, the information separation unit 22 separates and extracts the compressed image data, the edge information data, and the color table data from the stream data received by the reception unit 21, and outputs the compressed image data to the image decompression unit 25. , And outputs the edge information data to the edge information storage unit 23, and outputs the color table data to the color table storage unit 24 (step S52).
[0053]
Next, the image decompression unit 25 decompresses (decodes) the JPEG-compressed compressed image data to generate decompressed image data (step S53).
Next, the filter unit 26 filters the decompressed image data of each block based on the value of the corresponding edge information data to generate filter image data (step S54).
[0054]
Here, details of the filtering performed by the filter unit 26 will be described.
First, the filter unit 26 reads from the edge information storage unit 23 the value (0 or 1) of the edge information data corresponding to each block (8 × 8 pixels) of the image to be filtered.
[0055]
As described above, if the edge strength of a block is equal to or larger than a predetermined threshold before the encoding by the image encoding device 1, the edge information data is decoded (expanded) to emphasize the edge. Information indicating that an edge enhancement filter is to be applied to the subsequent image data (for example, 1 in the case of binary values of 0 and 1) is stored. If the edge strength is less than the threshold before encoding, the edge is added to the block. It is data that stores information indicating that a low-pass filter is to be applied to the decoded (decompressed) image data of the block (for example, 0 in the case of binary 0, 1), assuming that there is no data.
[0056]
When the value of the edge information data corresponding to each block is 1, the filter unit 26 performs correction by applying an edge emphasis filter for emphasizing the edge to the expanded image data of the block. As a filtering process for enhancing the edge, for example, a high-frequency component is added to the image data of this block.
[0057]
On the other hand, when the value of the edge information data corresponding to each block is 0, the filter unit 26 performs correction by applying a low-pass filter to the decompressed image data of the block.
[0058]
As described above, the above-described filtering processing is performed on all blocks of the image.
As described above, based on the edge strength in the image data of the original image before encoding (compression) by the image encoding device 1, filtering processing is performed on the image data after decoding (decompression) so as to correspond to the original image. Do. For this reason, it is possible to reduce noise generated near an edge or a flat portion when an image is encoded (compressed).
[0059]
Next, the color conversion unit 27 converts the pixel value of each pixel of the filter image data generated by the filter unit 26 based on the color table data stored in the color table storage unit 24, and performs color correction. The converted image data (decoded image data) is generated (step S55).
[0060]
Here, the operation performed by the color conversion unit 27 will be described in detail.
The color conversion unit 27 sequentially reads the RGB values of all pixels of the filter image data generated by the filter unit 26.
[0061]
For example, assume that the image 50 shown in FIG. 3B is encoded (compressed) by the image encoding device 1, decoded by the image decompression unit 25 of the image decoding device 2, and output from the filter unit 26. . Then, when compressed (encoded), the RGB value of the pixel 50a of the image 50 is changed from the RGB value (R value = 43, G value = 56, B value = 18) to the RGB value (R value = 44, G value = 57, B value = 18).
[0062]
The color conversion unit 27 obtains the R value = 44, the G value = 57, and the B value = 18 from the filter unit 26 as the RGB values of the pixel 50a in the image 50. Then, the color conversion unit 27 calculates which of the set of RGB values in the color table data 40 stored in the color table storage unit 24 is closer to the obtained RGB value, and calculates the closest RGB value. Select a set of RGB values.
[0063]
As a method of selecting the RGB values, the R value, the G value, and the B value of the set of the RGB values stored in the color table data 40 and the R value, the G value, and the B value of the image output from the filter unit 26 are used. The one with the smallest sum of squares of the difference from each of the values (the closest distance) is selected from the set of RGB values stored in the color table data 40.
[0064]
For example, in this case, the sum of squares when the RGB value 40a is selected is (44-43) 2 + (57-56) 2 + (18-18) 2 = 2, and the sum of squares when the RGB value 40b is selected is (79-44) 2 + (94-57) 2 + (146-18) 2 = 18978. The color conversion unit 27 selects the one with the smallest sum of squares calculated in this manner from all the sets of RGB values held in the color table data 40.
[0065]
As described above, the color conversion unit 27 selects an RGB value that is close to the decoded RGB value of the pixel 50a, thereby selecting the same pixel 50a from the set of RGB values stored in the color table data 40. Will be selected before encoding. Since the change in color due to image compression (encoding) does not become large, by selecting RGB values close to each other as described above, the RGB values of the same pixels as before encoding can be selected.
[0066]
Then, the color conversion unit 27 converts the RGB values (R value = 44, G value = 57, B value = 18) of the pixel 50a of the image 50 obtained from the filter unit 26 from the RGB values ( R value = 43, G value = 56, B value = 18), that is, conversion into RGB values before encoding.
[0067]
At this time, the RGB value of the pixel 50c of the image 50 before encoding is the RGB value 40a, and an RGB value close to the RGB value of the pixel 50c after decoding is selected from the color table data 40 as described above. Thus, the RGB value 40a is selected. By using the same RGB values for the different pixels 50a and 50c as one table data (RGB value 40a), the amount of memory used for the color table data 40 can be reduced.
[0068]
Then, the above-described conversion is performed on all the pixels of the image to generate converted image data.
As described above, the color conversion unit 27 converts the RGB values before encoding into RGB values, so that when the image is compressed (at the time of encoding), the color changes and the deteriorated image quality is improved.
[0069]
Next, the image output unit 28 displays the decoded image based on the converted image data (decoded image data) (Step S56), and ends the processing.
As described above, according to the present embodiment, by converting the color of an image after decoding into the color of an original image before encoding, the image quality deteriorates due to a change in color during JPEG compression. In particular, in the case of an image having a clear color tone such as a graphic image, a change in color due to compression is conspicuous, which is effective.
[0070]
Further, in the present embodiment, by selecting, from the color table data 40, an RGB value close to the decoded RGB value of a certain pixel from the color table data 40, the RGB value of the same pixel before encoding is specified and obtained. Therefore, the color table data 40 does not have pixel information indicating which pixel each RGB value corresponds to. Therefore, there is an advantage that the color table data 40 uses less memory for the pixel information.
[0071]
Note that the color table data 40 may be data having the above-described pixel information indicating which pixel each RGB value corresponds to. For example, pixel information indicating that the RGB values 40a (R value = 43, G value = 56, B value = 18) of the color table data 40 shown in FIG. May have. Then, in the image decoding device 2, the color conversion unit 27 may convert the RGB value of a certain pixel after decoding into the RGB value of the same pixel in the color data table 40 based on the pixel information.
[0072]
Further, in the present embodiment, in the image encoding device 1, the edge information generation unit 13 detects the edge strength for each image block, and in the image decoding device 2, the edge information storage unit 23 stores the edge intensity. Although the filter unit 26 filters the image signal based on the stored edge strength, the filter unit 26 does not include the edge information generation unit 13 and the edge information storage unit 23, and does not detect the edge strength. Alternatively, the filter unit 26 may perform filtering by a predetermined method.
[0073]
Further, the filter unit 26 may analyze the decompressed image output from the image decompression unit 25, and adaptively determine a filtering method according to the analysis result.
FIG. 5 shows an example of the format of the stream data 60 transmitted by the image encoding device 1 and received by the image decoding device 2, but the order of each data area such as the edge information header 61 and the edge information data 62 is shown. May be different from the order shown in FIG. Further, the data lengths of the edge information data 62 and the color table data 64 may be fixed, and the edge information header 61 and the color table header 63 may be omitted. Furthermore, other data may be included in the stream data 60.
[0074]
Further, one color table data 40 shown in FIG. 3A is set as one color table data for one image 50 shown in FIG. 3B, but the image 50 is divided into a plurality of areas. One color table data may be set for each divided area. Also, one color table data may be set for a plurality of images. Further, the values to be written in the color table data 40 are RGB values, but other values such as a combination of luminance and color difference may be used as values indicating colors.
[0075]
Further, the color conversion unit 27 converts the RGB values output from the filter unit 26 into the RGB values that minimize the sum of squares (distance) of the differences among the RGB values included in the color table data 40. The method is not limited to this method as long as the RGB values of the same pixel before encoding are converted. In addition, a certain pixel value output from the filter unit 26 may not be converted according to a result of obtaining a distance from each RGB value of the color table data 40.
[0076]
Further, the edge information generation unit 13 generates information indicating the type of filter (edge enhancement filter, low-pass filter) for each block of 8 × 8 pixels as edge information data, but the size of the block is reduced to 8 × 8 pixels. The present invention is not limited to this, and may be a line such as 1 × 8 pixels. Further, the type of filter may be other than the edge emphasizing filter and the low-pass filter, and information other than the type of filter, such as a filter coefficient and a direction in which the filter is applied, may be written to the edge information data. Further, a value indicating the edge strength for each block may be written as the edge information data, or an edge image may be used as the edge information data.
[0077]
Further, although the filter processing is performed on the decompressed image data decompressed by the image decompression unit 25, the frequency coefficient included in the compressed image data may be filtered in the image decompression unit 25.
[0078]
Further, preprocessing such as filtering and color reduction processing may be performed on the image data output by the image input unit 11 of the image encoding device 1.
In addition, the image encoding device 1 is provided with a decoding function equivalent to that of the image decoding device 2, and the encoding is performed again based on the image generated by encoding and decoding by the image encoding device 1. Is also good.
[0079]
Further, the image encoding device 1 may record the stream data generated by the information multiplexing unit 15 on a recording medium. Further, the image decoding device 2 may receive stream data from a recording medium.
[0080]
Further, although JPEG compression has been described as an irreversible compression method for an image, another irreversible compression method such as MPEG compression may be used.
[0081]
【The invention's effect】
As is apparent from the above description, according to the present invention, it is possible to correct a decoded image so as to correspond to a color before compression encoding based on color data. For this reason, the image quality deteriorates due to a change in color during compression encoding. In particular, it is effective for an image having a clear color tone, such as a graphic image, because the color change is conspicuous.
[Brief description of the drawings]
FIG. 1 is a block diagram illustrating a configuration of an image encoding device and an image decoding device that implement an image encoding method and an image decoding method according to an embodiment of the present invention.
FIG. 2 is a flowchart showing an operation of the image encoding device according to the embodiment of the present invention.
FIG. 3A is a data diagram illustrating color table data in an image encoding device according to an embodiment of the present invention, and FIG. 3B is an explanatory diagram used to explain an image to be encoded.
FIG. 4 is a flowchart showing an operation of the image decoding device according to the embodiment of the present invention.
FIG. 5 is a data diagram showing a structure of stream data output from the image encoding device according to the embodiment of the present invention.
FIG. 6 is a block diagram illustrating a configuration of a conventional image encoding device and a conventional image decoding device.
[Explanation of symbols]
1 Image encoding device
2 Image decoding device
11 Image input section
12 Image compression unit
13 Edge information generation unit
14 Color table generator
15 Information multiplexing unit
16 Transmission section
21 Receiver
22 Information Separation Unit
23 Edge information storage
24 Color table storage
25 Image expansion unit
26 Filter section
27 Color converter
28 Image output unit
40 color table data
50 images
60 stream data

Claims (22)

入力画像を圧縮符号化して圧縮画像データを生成する符号化ステップと、
前記圧縮符号化前の入力画像の色を示す色データを生成する色データ生成ステップと、
前記圧縮画像データと前記色データからストリームデータを生成するストリーム生成ステップと
を含むことを特徴とする画像符号化方法。
An encoding step of compressing and encoding the input image to generate compressed image data;
A color data generating step of generating color data indicating a color of the input image before the compression encoding;
An image encoding method, comprising: a stream generating step of generating stream data from the compressed image data and the color data.
前記色データ生成ステップでは、前記入力画像における各画素に対応する色情報値からなる色データを生成する
ことを特徴とする請求項1に記載の画像符号化方法。
The image encoding method according to claim 1, wherein in the color data generating step, color data including color information values corresponding to respective pixels in the input image is generated.
前記色データ生成ステップでは、前記各画素に対応する色情報値のうち、異なる画素における同じ値の色情報値を1つのデータとする色データを生成する
ことを特徴とする請求項2に記載の画像符号化方法。
3. The color data generating step according to claim 2, wherein, in the color data generating step, among the color information values corresponding to the respective pixels, color data having the same color information value in different pixels as one data is generated. Image coding method.
前記色情報値はRGB値である
ことを特徴とする請求項2または請求項3に記載の画像符号化方法。
The image encoding method according to claim 2, wherein the color information value is an RGB value.
当該画像符号化方法では、さらに圧縮符号化前の前記入力画像のエッジ強度を検出し、前記入力画像の圧縮符号化前のエッジ強度を示すエッジ情報データを生成するエッジ情報生成ステップを含み、
前記ストリーム生成ステップでは、前記圧縮画像データと前記色データと前記エッジ情報データとからストリームデータを生成する
ことを特徴とする請求項1から請求項4のいずれか1項に記載の画像符号化方法。
The image encoding method further includes an edge information generating step of detecting edge strength of the input image before compression encoding, and generating edge information data indicating edge strength before compression encoding of the input image,
The image encoding method according to any one of claims 1 to 4, wherein in the stream generating step, stream data is generated from the compressed image data, the color data, and the edge information data. .
前記エッジ情報生成ステップでは、前記入力画像における所定数の画素毎のエッジ強度が所定値以上であるか否かを示すエッジ情報データを生成する
ことを特徴とする請求項5に記載の画像符号化方法。
6. The image encoding apparatus according to claim 5, wherein in the edge information generating step, edge information data indicating whether an edge intensity of each of a predetermined number of pixels in the input image is equal to or more than a predetermined value is generated. Method.
入力画像を圧縮符号化して生成される圧縮画像データと、
圧縮符号化前の前記入力画像の色を示す色データと
を含むことを特徴とするストリームデータが記録された記録媒体。
Compressed image data generated by compression encoding the input image;
And a color data indicating a color of the input image before compression encoding.
前記入力画像の圧縮符号化前のエッジ強度を示すエッジ情報データをさらに含むことを特徴とするストリームデータが記録された請求項7に記載の記録媒体。The recording medium according to claim 7, further comprising edge information data indicating edge strength of the input image before compression encoding, wherein the stream data is recorded. 入力されたストリームデータから、圧縮符号化された画像の圧縮画像データ、および前記画像における圧縮符号化前の色を示す色データを抽出する抽出ステップと、
前記圧縮画像データを伸長復号化して伸長画像データを生成する復号化ステップと、
前記伸長画像データの色を前記色データに基づいて変換する変換ステップと
を含むことを特徴とする画像復号化方法。
Extracting, from the input stream data, compressed image data of a compression-encoded image and color data indicating a color of the image before compression-encoding,
A decoding step of expanding and decoding the compressed image data to generate expanded image data;
Converting the color of the decompressed image data based on the color data.
前記色データは、前記画像における圧縮符号化前の各画素に対応する色情報値を有しており、
前記変換ステップでは、前記伸長画像データにおける各画素の色情報値を前記色データにおける対応する画素の色情報値に変換する
ことを特徴とする請求項9に記載の画像復号化方法。
The color data has a color information value corresponding to each pixel before compression encoding in the image,
10. The image decoding method according to claim 9, wherein in the conversion step, the color information value of each pixel in the expanded image data is converted into the color information value of a corresponding pixel in the color data.
前記変換ステップでは、前記伸長画像データにおける所定の画素の色情報値を、前記色データにおける、前記所定の画素の色情報値と近い値の色情報値に変換する
ことを特徴とする請求項10に記載の画像復号化方法。
11. The method according to claim 10, wherein in the converting step, a color information value of a predetermined pixel in the expanded image data is converted into a color information value in the color data that is close to a color information value of the predetermined pixel. 5. The image decoding method according to claim 1.
前記色情報値は、RGB値であることを特徴とする請求項10または請求項11に記載の画像復号化方法。The image decoding method according to claim 10, wherein the color information value is an RGB value. 前記抽出ステップでは、さらに前記入力されたストリームデータから前記圧縮符号化前の画像のエッジ強度を示すエッジ情報データを抽出し、
当該画像復号化方法はさらに、前記エッジ情報データに基づいて、前記伸長画像データを補正する補正ステップを含む
ことを特徴とする請求項9から請求項12のいずれか1項に記載の画像復号化方法。
In the extracting step, edge information data indicating the edge strength of the image before the compression encoding is further extracted from the input stream data,
The image decoding method according to any one of claims 9 to 12, further comprising a correction step of correcting the decompressed image data based on the edge information data. Method.
前記エッジ情報データは、前記圧縮符号化前の画像における所定数の画素毎のエッジ強度が所定値以上であるか否かを示すデータであり、
前記補正ステップでは、所定数の画素毎のエッジ強度が所定値以上であるときは、前記伸長画像データにおける対応する所定数の画素毎のエッジ強度を強調するように補正する
ことを特徴とする請求項13に記載の画像復号化方法。
The edge information data is data indicating whether the edge strength of each of a predetermined number of pixels in the image before the compression encoding is equal to or greater than a predetermined value,
In the correcting step, when the edge strength of each of the predetermined number of pixels is equal to or more than a predetermined value, correction is performed so as to emphasize the edge strength of each of the corresponding predetermined number of pixels in the expanded image data. Item 14. The image decoding method according to Item 13.
入力画像を圧縮符号化して圧縮画像データを生成する符号化手段と、
前記圧縮符号化前の入力画像の色を示す色データを生成する色データ生成手段と、
前記圧縮画像データと前記色データからストリームデータを生成するストリーム生成手段と
を備えることを特徴とする画像符号化装置。
Encoding means for compressing and encoding the input image to generate compressed image data;
Color data generating means for generating color data indicating the color of the input image before the compression encoding,
An image encoding apparatus comprising: a stream generation unit configured to generate stream data from the compressed image data and the color data.
当該画像符号化装置は、さらに圧縮符号化前の前記入力画像のエッジ強度を検出し、前記入力画像の圧縮符号化前のエッジ強度を示すエッジ情報データを生成するエッジ情報生成手段を備え、
前記ストリーム生成手段は、前記圧縮画像データと前記色データと前記エッジ情報データとからストリームデータを生成する
ことを特徴とする請求項15に記載の画像符号化装置。
The image encoding apparatus further includes an edge information generating unit that detects edge strength of the input image before compression encoding and generates edge information data indicating edge strength before compression encoding of the input image,
16. The image encoding apparatus according to claim 15, wherein the stream generation unit generates stream data from the compressed image data, the color data, and the edge information data.
前記ストリーム生成手段が生成したストリームデータを送信する送信手段をさらに備える
ことを特徴とする請求項15または請求項16に記載の画像符号化装置。
17. The image encoding apparatus according to claim 15, further comprising a transmission unit configured to transmit the stream data generated by the stream generation unit.
入力されたストリームデータから、圧縮符号化された画像の圧縮画像データ、および前記画像における圧縮符号化前の色を示す色データを抽出する抽出手段と、
前記圧縮画像データを伸長復号化して伸長画像データを生成する復号化手段と、
前記伸長画像データの色を前記色データに基づいて変換する変換手段と
を備えることを特徴とする画像復号化装置。
Extraction means for extracting, from the input stream data, compressed image data of a compression-encoded image and color data indicating a color of the image before compression-encoding,
Decoding means for decompressing and decoding the compressed image data to generate decompressed image data;
An image decoding device comprising: a conversion unit configured to convert a color of the decompressed image data based on the color data.
前記抽出手段は、さらに前記入力されたストリームデータから前記圧縮符号化前の画像のエッジ強度を示すエッジ情報データを抽出し、
当該画像復号化装置はさらに、前記エッジ情報データに基づいて、前記伸長画像データを補正する補正手段を備える
ことを特徴とする請求項18に記載の画像復号化装置。
The extracting means further extracts edge information data indicating the edge strength of the image before compression encoding from the input stream data,
19. The image decoding apparatus according to claim 18, further comprising a correction unit configured to correct the decompressed image data based on the edge information data.
前記ストリームデータを受信し、前記抽出手段に出力する受信手段をさらに備えることを特徴とする請求項18または請求項19に記載の画像復号化装置。20. The image decoding apparatus according to claim 18, further comprising a receiving unit that receives the stream data and outputs the stream data to the extracting unit. 請求項1から請求項6のいずれか1項に記載の画像符号化方法におけるすべてのステップをコンピュータに実行させることを特徴とするプログラム。A program for causing a computer to execute all steps in the image encoding method according to any one of claims 1 to 6. 請求項9から請求項14のいずれか1項に記載の画像復号化方法におけるすべてのステップをコンピュータに実行させることを特徴とするプログラム。A program for causing a computer to execute all steps in the image decoding method according to any one of claims 9 to 14.
JP2003047414A 2003-02-25 2003-02-25 Method for encoding image and method for decoding image Pending JP2004260415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003047414A JP2004260415A (en) 2003-02-25 2003-02-25 Method for encoding image and method for decoding image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003047414A JP2004260415A (en) 2003-02-25 2003-02-25 Method for encoding image and method for decoding image

Publications (1)

Publication Number Publication Date
JP2004260415A true JP2004260415A (en) 2004-09-16

Family

ID=33113676

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003047414A Pending JP2004260415A (en) 2003-02-25 2003-02-25 Method for encoding image and method for decoding image

Country Status (1)

Country Link
JP (1) JP2004260415A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008152797A1 (en) * 2007-06-12 2008-12-18 Panasonic Corporation Statistic image improving method, image encoding method, and image decoding method
WO2010035403A1 (en) * 2008-09-25 2010-04-01 パナソニック株式会社 Filter device and filter method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008152797A1 (en) * 2007-06-12 2008-12-18 Panasonic Corporation Statistic image improving method, image encoding method, and image decoding method
JP5271900B2 (en) * 2007-06-12 2013-08-21 パナソニック株式会社 Image coding method, image decoding method, image enhancement method, image coding device, image decoding device, image enhancement device, image processing device, image processing system, program, and integrated circuit
US8588545B2 (en) 2007-06-12 2013-11-19 Panasonic Corporation Statistical image enhancing method, image coding method, and image decoding method
WO2010035403A1 (en) * 2008-09-25 2010-04-01 パナソニック株式会社 Filter device and filter method

Similar Documents

Publication Publication Date Title
US7155067B2 (en) Adaptive edge detection and enhancement for image processing
US7536055B2 (en) Image compression device, image output device, image decompression device, printer, image processing device, copier, image compression method, image decompression method, image processing program, and storage medium storing the image processing program
JP2004173011A (en) Apparatus and method for processing image signal, apparatus and method for generating coefficient data used therefor, and program for implementing each method
JP2002238054A (en) Image-coding decoding method, image coder and image decoder
US7068845B2 (en) Information processing apparatus using class-classification adaptive processing
JP5691374B2 (en) Data compression device
JP4288398B2 (en) Image recording apparatus, image reproducing apparatus, and recording medium recording image processing program
JP4592562B2 (en) Image decoding device
JP2001285881A (en) Digital information converter and method, and image information converter and method
US20080205784A1 (en) Methods and Apparatus for Processing of a Digital Image
JP2004260415A (en) Method for encoding image and method for decoding image
JP4185011B2 (en) Image processing apparatus, image processing method, and image processing program
KR100412176B1 (en) Document segmentation compression, reconstruction system and method
JPH09307897A (en) Image data compression processing method
JPH06178122A (en) Adaptive encoding device for color image
JP2003224868A (en) Image compression apparatus, image compression method, image compression program, and image expansion program
JP3896635B2 (en) Image data conversion apparatus and method, prediction coefficient generation apparatus and method
JP3781012B2 (en) Image data compression method, image data expansion method, and image data expansion circuit
JPH08275153A (en) Image compressor and image decoder
JP2001285882A (en) Device and method for reducing noise
JP2891251B2 (en) Image encoding device and image decoding device
JP4552264B2 (en) Error correction apparatus and method
JP2001177848A (en) Image data coding method, its device, image data decoding method, its device and image companding method
JP2584854B2 (en) Image coding method
WO2005062623A1 (en) Moving image reproducing method, apparatus and program