JP3988371B2 - Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera - Google Patents

Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera Download PDF

Info

Publication number
JP3988371B2
JP3988371B2 JP2000283345A JP2000283345A JP3988371B2 JP 3988371 B2 JP3988371 B2 JP 3988371B2 JP 2000283345 A JP2000283345 A JP 2000283345A JP 2000283345 A JP2000283345 A JP 2000283345A JP 3988371 B2 JP3988371 B2 JP 3988371B2
Authority
JP
Japan
Prior art keywords
image data
compression
data size
ratio
jpeg
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP2000283345A
Other languages
Japanese (ja)
Other versions
JP2002094800A (en
Inventor
和洋 坂本
和人 最上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2000283345A priority Critical patent/JP3988371B2/en
Publication of JP2002094800A publication Critical patent/JP2002094800A/en
Application granted granted Critical
Publication of JP3988371B2 publication Critical patent/JP3988371B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、画像データの圧縮方法に関し、元画像データを指定されたサイズの圧縮画像データにJPEG圧縮する画像データの圧縮方法、画像データ圧縮プログラムを記録したコンピュータ読み取り可能な記録媒体、ならびにデジタルスチルカメラに関する。
【0002】
【従来の技術】
従来より、写真画像などのフルカラー静止画像の画像データを不可逆圧縮するファイル形式としてJPEG(Joint Photographic Experts Group)形式が広く利用されている。JPEGファイルは、一般に画像本体、ヘッダおよびサムネイルデータから構成されている。
画像データをJPEGファイル形式で圧縮する場合(以下、JPEGファイル形式での圧縮を「JPEG圧縮」という。)、圧縮率を指定し、指定された圧縮率にしたがって元画像データにJPEG圧縮が実施される。
【0003】
【発明が解決しようとする課題】
しかしながら、圧縮された後のJPEGファイルに含まれる画像本体のデータサイズは元画像の画質に依存している。例えば、空など色の変化が少ない画像はJPEG圧縮後の画像本体のデータサイズが小さくなる。一方、例えば、記念写真などのように風景と人物とが混在する色の変化が多い画像はJPEG圧縮後の画像本体のデータサイズが大きくなる。すなわち、元画像の画像本体のデータサイズおよび圧縮率が同一であってもJPEG圧縮を実施した後の画像本体のデータサイズは一定とはならない。そのため、JPEG圧縮後の画像本体のデータサイズを予測することができず、所望するデータサイズとするために圧縮率を指定しても、圧縮後の画像データのデータサイズと所望するデータサイズとが等しくならない。その結果、例えばデジタルスチルカメラを使用する場合、記録装置として使用されるフラッシュメモリなどへの記録可能枚数を知ることが困難である。
【0004】
そこで、標準画像を設定し、その標準画像のJPEG圧縮後の画像本体のデータサイズと圧縮率との関係を求めることにより、JPEG圧縮後の画像本体のデータサイズを予測することが考えられる。しかし、設定される標準画像が1つである場合、元画像の画質に対する依存性が高く、予測誤差すなわち予測したデータサイズと実際のJPEG圧縮後のデータサイズとの差が大きいという問題がある。一方、標準画像を複数設定することにより画質への依存度が減少する。しかし、標準画像を複数設定すると、JPEG圧縮後の画像本体のデータサイズと圧縮率との関係を示すデータサイズが大きくなる。そのため、必要とする記録装置の容量が増大し、コストの上昇を招くという問題がある。また、標準画像を複数設定すると、標準画像の選択ならびに標準画像と圧縮率との関係を示すデータの検索など処理が複雑化し、高速な処理が困難になるという問題がある。
【0005】
そこで、本発明の目的は、処理が単純で、指定された圧縮後のデータサイズとJPEG圧縮後のデータサイズとの差が小さな画像データの圧縮方法、画像データ圧縮プログラムが記録されたコンピュータ読み取り可能な記録媒体およびデジタルスチルカメラを提供することにある。
【0006】
【課題を解決するための手段】
本発明の請求項1記載の画像データの圧縮方法ならびに請求項6記載の画像データ圧縮プログラムが記録された記録媒体によると、元画像データから縮小画像データを作成し、作成された縮小画像データを所定の圧縮率でJPEG圧縮する。圧縮された縮小画像データのデータサイズから元画像データをJPEG圧縮した場合の画像データサイズを推定する。推定された推定画像データサイズと指定データサイズとのデータサイズ比を算出し、算出されたデータサイズ比から元画像データをJPEG圧縮する場合の実行圧縮率が決定される。縮小画像データの圧縮後のデータサイズと元画像データの圧縮後のデータサイズとの間には相関性があるため、縮小画像データと同一の圧縮率でJPEG圧縮した後の元画像データのデータサイズを推定することができる。推定された推定画像データサイズと指定データサイズとのデータサイズ比を算出することで、例えばデータサイズ比と実行圧縮率との相関データを利用し元画像データの最適な圧縮率を決定することができる。したがって、指定データサイズと実際に圧縮された元画像データのデータサイズとの差を小さくすることができる。
【0007】
縮小画像データのJPEG圧縮は通常のJPEG圧縮で実施される処理であるため、これに加え推定画像データサイズの算出、データサイズ比の算出および実行圧縮率の決定の処理が必要である。推定画像データサイズの算出は例えば縮小画像データとの画素数の比を乗ずる処理、データサイズ比の算出は例えば推定画像データサイズと指定データサイズとを除する処理、ならびに実行圧縮率の決定は例えばデータサイズ比と実行圧縮率との相関関係を示す数式による演算または相関関係が記録されたテーブルの検索などいずれも単純な処理である。したがって、画像データの圧縮処理を高速で実行することができる。
【0008】
更に、本発明の請求項1記載の画像データの処理方法または請求項6記載の画像データ圧縮プログラムが記録された記録媒体によると、実行圧縮率は圧縮率算出テーブルから決定される。圧縮率算出テーブルはデータサイズ比と実行圧縮率との関係が設定されている。圧縮率算出テーブルを用いることにより、実行圧縮率の決定を高速に実施することができる。
【0009】
本発明の請求項2もしくは3記載の画像データの処理方法または請求項7もしくは8記載の画像データ圧縮プログラムが記録された記録媒体によると、圧縮率算出テーブルは圧縮後の縮小画像データのデータサイズに応じて複数設定されている。そのため、元画像データの画質にかかわらず最適な圧縮率の決定を高速で実施することができる。また、圧縮率算出テーブルは例えば1から100までの圧縮率に対応するデータサイズ比が設定されているため、圧縮率算出テーブルを複数設定してもデータサイズは小さく、圧縮率算出テーブルを記録するための記録装置の容量を低減することができる。
【0010】
本発明の請求項4記載の画像データの処理方法または請求項9記載の画像データ圧縮プログラムが記録された記録媒体によると、推定画像データサイズは元画像データの画素数と縮小画像データの画素数との比である画素数比を用いて算出される。そのため、元画像データの画素数に関わりなく推定画像データサイズを算出することができる。
【0011】
本発明の請求項5記載の画像データ処理方法または請求項10記載の画像データ圧縮プログラムが記録された記録媒体によると、推定画像データサイズは縮小画像データのJPEG圧縮後のデータサイズに画素数比を乗ずることにより算出される。そのため、推定画像データサイズの算出を高速で実施することができる。
【0012】
本発明の請求項11記載のデジタルスチルカメラによると、データサイズ入力手段および圧縮画像データ作成部を備えている。データサイズ入力手段からは元画像データをJPEG圧縮することにより所望のデータサイズとするための指定データサイズが入力される。圧縮画像データ作成部では入力手段から入力された指定画像データサイズに応じて元画像データを圧縮し、指定画像データサイズとほぼ同一サイズの圧縮画像データが作成される。したがって、指定されたサイズの圧縮画像データを作成することができ、記録部に記録可能な圧縮画像データのデータ量を容易に推定することができる。
【0013】
【発明の実施の形態】
本発明の実施の形態を示す一実施例を図面に基づいて説明する。
図2は、本発明の一実施例による画像処理装置を適用したデジタルスチルカメラ(以下、デジタルスチルカメラを「デジタルカメラ」という。)1である。
図2に示すようにデジタルカメラ1は、制御部10、画像入力部20、記録部30、表示部40およびインターフェイス50などから構成されている。
【0014】
制御部10は画像入力部20から出力された電子データを処理する。制御部10は、CPU(Central Processing Unit)11、ROM(Read Only Memory)12および画像処理部6を有している。ROM12には、制御部10のCPU11および画像処理部6で実行されるコンピュータプログラムが記録されている。
【0015】
図2に示すように制御部10には、ユーザからの入力を受け付けるための入力手段が接続されている。入力手段としては、ユーザから撮影の実行の指示が入力されるシャッターボタン71、ならびにデジタルカメラ1の種々の機能の操作、ならびにデータサイズ入力手段としての複数の入力ボタン72などがある。図3に示すように、入力ボタン72はデジタルカメラ1の背面部に配設されている。入力ボタン72からは、デジタルカメラ1で撮影を実行する際の露出あるいはシャッタースピードなどの撮影情報、ならびに撮影後の画像データをJPEG圧縮する際に所望する圧縮後のデータサイズが指定データサイズとして入力される。
【0016】
図2に示すように画像入力部20は、集光レンズ21、撮像手段としてのCCD22およびA/D変換器23を有している。集光レンズ21は被写体からの光をCCD22へ集光する。CCD22は複数の画素を有しており、水平方向ならびに垂直方向にマトリクス状に画素が複数個配置されている。
【0017】
画素は、受光面側にそれぞれカラーフィルタが配置されている。カラーフィルタとしては、Cy(Cyan)、Mg(Magenta)、Ye(Yellow)およびG(Green)からなる補色フィルタが使用されている。CCD22では各撮像素子へ入射された光が電気信号に変換されて出力される。CCD22から出力された電気信号はアナログ信号であるので、A/D変換器23でデジタルの電子データへ変換される。
【0018】
記録部30は、RAM(Random Access Memory)31およびフラッシュメモリ32を有している。RAM31としては、セルフリフレッシュ機能を有するDRAM(Dynamic RAM)が用いられる。フラッシュメモリ32は通電しなくても記録内容を保持することができる書き換え可能な記録媒体であり、デジタルカメラ1に内蔵されているか、またはデジタルカメラ1に着脱自在に取り付けられている。
【0019】
RAM31は、制御部10で処理またはA/D変換器23から出力されたデジタルの電子データ、ならびに画像処理部6で作成された画像データなどを一時的に記録する。フラッシュメモリ32は、RAM31に一時的に記録されている画像データからJPEG圧縮により作成された圧縮画像データを蓄積して保管する。
【0020】
表示部40は、液晶表示装置(LCD)41およびVRAM(Video RAM)42を有している。LCD41はフラッシュメモリ32に記録されている電子データまたはA/D変換器23から出力されたデジタルの電子データに基づく画像を表示する。VRAM42にはLCD41で表示するために電子データから作成される表示データが記録されている。
インターフェイス50は、フラッシュメモリ32に記録されている圧縮画像データを外部の例えばパーソナルコンピュータなどの機器に出力する。
【0021】
図4に示すように画像処理部6は、画像データ作成部61および圧縮画像データ作成部62から構成されている。画像データ作成部61では、CCD22から出力されA/D変換器23でデジタルに変換された電子データに露出補正、色調補正、ホワイトバランスの調整あるいはノイズの除去などを実施し、画像データを作成する。画像データ作成部61で作成された画像データがJPEG圧縮前の元画像データである。圧縮画像データ作成部62では、元画像データをJPEG圧縮し、圧縮画像データを作成する。
【0022】
次に、圧縮画像データ作成部62について詳細に説明する。
圧縮画像データ作成部62は、図5に示すように縮小画像データ作成部621、JPEG圧縮部622および圧縮率決定部623を有している。縮小画像データ作成部621は、圧縮される元画像データから縮小画像データを作成する。JPEG圧縮部622は、元画像データおよび縮小画像データをJPEG圧縮する。圧縮率決定部623は、縮小画像データをJPEG圧縮して得られる圧縮後の縮小画像データ(以下、JPEG圧縮して得られる圧縮後の縮小画像データを「サムネイル」という。)のデータサイズから当該元画像データをJPEG圧縮したときのデータサイズを推定し圧縮率を決定する。
【0023】
圧縮率決定部623は、図6に示すようにさらに推定画像データサイズ算出部623a、選択部623b、データサイズ比算出部623cおよび圧縮率算出部623dを有している。推定画像データサイズ算出部623aは、サムネイルのデータサイズから元画像データに含まれる画像本体をJPEG圧縮したときの圧縮後の推定データサイズを算出する。選択部623bは、サムネイルのデータサイズに応じてあらかじめ複数設定されROM12に記録されている圧縮率算出テーブルから、所定の圧縮率算出テーブルを選択する。データサイズ比算出部623cは、入力ボタン72から入力された指定データサイズと推定画像データのデータサイズとのデータサイズ比を算出する。圧縮率算出部623dは、選択部623bで選択された圧縮率算出テーブルとデータサイズ比算出部623cで算出されたデータサイズ比とから元画像データを圧縮する際の圧縮率を決定する。
【0024】
次に、上記構成のデジタルカメラ1による画像データの処理について説明する。デジタルカメラ1による撮影、ならびに撮影された画像データの記録についての処理の流れは図7に示すとおりである。
ユーザにより図示しないデジタルカメラ1の電源スイッチがオンにされ(S100)、シャッターボタン71が押し込まれると、以下のように撮影が実行される(S200)。
【0025】
被写体からの光は集光レンズ21によりCCD22へ集光される。CCD22では集光された光が電気信号に変換され出力される。出力された電気信号はアナログ信号であるので、A/D変換器23でデジタルの電子データに変換される。この電子データは、画像データ作成部61により色調や露出の補正ならびに画素の補正または補間など各種の画像処理が実施された後、適切な画像データとして作成される(S300)。作成された画像データはRAM31に一時的に格納される。作成された画像データは圧縮画像データ作成部62で圧縮され(S400)、フラッシュメモリ32に記録される(S500)。
【0026】
撮影が完了すると、ユーザは入力ボタン72から画像データをJPEG圧縮したのちに所望するデータサイズを指定する。指定されたデータサイズは指定データサイズDSsとして設定される。指定データサイズDSsは、撮影した画像の品質によってあらかじめ決定されている。すなわち、ユーザはJPEG圧縮後のデータサイズを直接指定するのではなく、入力ボタン72を用いて例えば「標準画質」、「精細画質」または「高精細画質」などの画像品質を選択する。この画像品質に応じて、JPEG圧縮後のデータサイズがあらかじめ決定されている。ユーザによって選択される画像品質に応じて決定されているデータサイズが指定データサイズDSsであり、この指定データサイズDSsを目標値としてJPEG圧縮が実行される。画像品質すなわち指定データサイズDSsは、撮影完了後ではなく、撮影実行前にあらかじめ入力ボタン72から入力することも可能である。
【0027】
圧縮画像データ作成部62でのJPEG圧縮処理について説明する。JPEGの圧縮処理は図7に示すステップS400における処理である。JPEG圧縮の処理は、図1に示すような流れで実施される。
縮小画像データ作成部621では、RAM31に記録された画像データのうち圧縮の対象となる画像データすなわち元画像データの画像データから縮小画像データが作成される(S410)。縮小画像データは、元画像データから形成される画像の画素を所定の割合で間引くことなどにより作成される。例えば、図8に示すように元画像データから形成される画像P1の画素数が1600×1200の約190万画素である場合、縮小画像P2の画素数は160×120の約19000画素となるように縮小される。この縮小画像P2の画像データが縮小画像データである。
【0028】
縮小画像データが作成されると、縮小画像データはJPEG圧縮部622に送られJPEG圧縮される(S420)。JPEG圧縮部622では、あらかじめ設定されている圧縮率Cdに基づいて縮小画像データが圧縮され、サムネイルが作成される。本実施例では圧縮率Cdを50%に設定している。
【0029】
JPEG圧縮部622でサムネイルが作成されると、サムネイルの画像本体のデータサイズ(以下、JPEG画像データに含まれる画像本体のデータサイズを「ビットストリームサイズ」という。)が圧縮率決定部623へ送られる。圧縮率決定部623へ送られたサムネイルのビットストリームサイズは、圧縮率決定部623の推定画像データサイズ算出部623aへ送られる。
【0030】
推定画像データサイズ算出部623aでは、サムネイルのビットストリームサイズBSrから元画像データをJPEG圧縮した場合の推定ビットストリームサイズBSeを算出する(S430)。推定ビットストリームサイズBSeは、下記の式(1)により算出される。
BSe=(P1/P2)×BSr (1)
【0031】
すなわち、推定ビットストリームサイズBSeは、サムネイルのビットストリームサイズBSrに元画像の画素数P1と縮小画像の画素数P2との比を乗じることにより算出される。
これは、サムネイルのビットストリームサイズBSrと元画像をサムネイルと同一の圧縮率でJPEG圧縮したときのビットストリームサイズの真値BSoとの比は、元画像の画素数P1と縮小画像の画素数P2との比に近似されるためである。すなわち、P1:P2≒BSo:BSrとなるためである。したがって本実施例の場合、BSe=100×BSrとなる。
【0032】
推定ビットストリームサイズBSeが算出されると、選択部623bによりサムネイルのビットストリームサイズBSrに適した圧縮率算出テーブルが選択される(S440)。圧縮率算出テーブルは、図9に示すようにデータサイズ比βと実行圧縮率との関係を示すものであり、サムネイルのビットストリームサイズBSrに応じて複数の圧縮率算出テーブルが設定されている。
【0033】
図9に示すような場合、圧縮率算出テーブルはサムネイルのビットストリームサイズBSrに応じて3つ設定されている。サムネイルのビットストリームサイズBSrが0Kバイト≦BSr<3Kバイトとなるのは、元画像が色の変化の少ないフラットな画像であるときである。一方、サムネイルのビットストリームサイズBSrが5Kバイト≦BSrとなるのは、元画像が色の変化が複雑な画像であるときである。サムネイルのビットストリームサイズBSrが3Kバイト≦BSr<5Kバイトとなるのは、元画像がそれらの中間的な画像であるときである。
したがって、選択部623bではサムネイルのビットストリームサイズBSrの値から特定の圧縮率算出テーブルが選択される。
【0034】
データサイズ比算出部623cでは、データサイズ比βが算出される(S450)。データサイズ比βは、入力ボタン72から入力され指定された指定データサイズDSsと推定ビットストリームサイズBSeとの比である。すなわち、下記の式(2)から算出される。
β=BSe/DSs (2)
例えば推定ビットストリームサイズBSeが200Kバイトであり、指定サイズ50Kバイトのとき、データサイズ比βは4となる。
【0035】
データサイズ比βが算出されると、圧縮率算出部623dでは選択部623bで選択された圧縮率算出テーブルからデータサイズ比βを用いて実行圧縮率Caが決定される(S460)。実行圧縮率Caはデータサイズ比βに応じて決定される。
例えば、データサイズ比βが4、サムネイルのビットストリームサイズBSrが2Kバイトであるとき、図9から実行圧縮率Caは10と決定される。
実行圧縮率Caが決定されると、JPEG圧縮部622で元画像データの画像本体のJPEG圧縮が実行される(S470)。
【0036】
元画像データのJPEG圧縮は下記の手順で実行される。
JPEG圧縮は公知のJPEG圧縮の手順のとおり、DCT変換、量子化およびハフマン変換により実行される。したがって、それらの詳細な説明は省略する。ここでは、決定された実行圧縮率CaでJPEG圧縮をする場合について説明する。通常、JPEG圧縮を実行する場合、DCT変換、量子化またはハフマン変換のいずれかの段階で圧縮が実行される。本実施例では、量子化の段階で量子化テーブルの係数を変更することにより圧縮を実行している。
【0037】
デフォルト状態の量子化テーブルは、例えば図10に示すように設定されている。量子化テーブルは、画像データに含まれる輝度成分用と色差成分用との2種類が設定されている。元画像データを圧縮する場合、図10に示すようなデフォルト状態の量子化テーブルから下記の式(3)に基づいて元画像データの圧縮に使用する量子化テーブルの各要素が算出される。
QTB’=(QTB×Q+50)/100 (3)
ここで、QTBは量子化テーブルの各要素、QTB’は元画像データの圧縮時に使用される量子化テーブルの各要素である。
【0038】
また、上記の式(3)に用いられる係数Qは、決定圧縮率Caによって設定される。
(A) 1≦Ca<50のとき、Q=5000/Ca
(B) 50≦Ca<100のとき、Q=200−2×Ca
(C) Ca<1のとき、Ca=1とし、Q=5000
(D) 100≦Caのとき、量子化テーブルの全要素を1
【0039】
(圧縮例1)
指定データサイズDSsを50Kバイト、サムネイルのビットストリームサイズBSrを2Kバイト、推定ビットストリームサイズBSeを150Kバイトとする。このとき、元画像データのビットストリームサイズの真値BSoは推定ビットストリームサイズBSeよりも小さい。
【0040】
式(2)よりβ=150/50=3となり、図9の圧縮率算出テーブルから決定圧縮率Ca=20と決定される。また、上記の係数Qの算出は、Ca=20であるから(A)が用いられ、Q=5000/20=250となる。デフォルト状態の量子化テーブルのある要素が16であるとすると、QTB’=(16×250+50)/100=4.5となる。このQTB’の計算をデフォルト状態の量子化テーブルのすべての要素について実施し、変更された量子化テーブルを用いて元画像データを量子化することにより元画像データに圧縮が実施される。
【0041】
(圧縮例2)
指定データサイズDSsを50Kバイト、サムネイルのビットストリームサイズBSrを2Kバイト、推定ビットストリームサイズBSeを20Kバイトとする。このとき、元画像データのビットストリームサイズの真値BSoは推定ビットストリームサイズBSeよりも大きい。
【0042】
式(2)よりβ=20/50=0.4となり、図9の圧縮率算出テーブルから決定圧縮率Ca=98と決定される。また、上記の係数Qの算出は、Ca=98であるから(B)が用いられ、Q=200−2×98=4となる。デフォルト状態の量子化テーブルのある要素が16であるとすると、QTB’=(16×4+50)/100=1.14となる。
【0043】
上記の処理により元画像データにJPEG圧縮処理が実行される。JPEG圧縮処理が完了すると、圧縮された元画像データはフラッシュメモリ32に記録される(S500)。
【0044】
以上説明したように、本発明の一実施例によるデジタルカメラ1、ならびにデジタルカメラ1で実行される画像データ圧縮方法によると、サムネイルのビットストリームサイズに応じて設定されている圧縮率算出テーブルを複数使用するため、元画像データの画質に対する推定ビットストリームサイズBSeの依存度が低い。そのため、元画像データのビットストリームサイズを指定されたデータサイズに近似することができる。
【0045】
また、圧縮までに必要となる処理は、通常のJPEG圧縮処理に加え、推定ビットストリームサイズBSeの算出、圧縮率算出テーブルの選択、ならびにデータサイズ比βの算出であるので、演算処理が単純であり、データサイズの推定を迅速に実行することができる。
【図面の簡単な説明】
【図1】本発明の一実施例によるデジタルカメラを用いた画像データの圧縮処理であって、JPEG圧縮の流れを示す説明図である。
【図2】本発明の一実施例によるデジタルカメラを示す模式的なブロック図である。
【図3】本発明の一実施例によるデジタルカメラを示す背面図である。
【図4】本発明の一実施例によるデジタルカメラの画像処理部を示すブロック図である。
【図5】本発明の一実施例によるデジタルカメラの主に圧縮画像データ作成部を示すブロック図である。
【図6】本発明の一実施例によるデジタルカメラの圧縮率決定部を示すブロック図である。
【図7】本発明の一実施例によるデジタルカメラを用いた画像データの圧縮処理の流れを示す説明図である。
【図8】元画像データと縮小画像データとの関係を示す説明図である。
【図9】圧縮率算出テーブルの一例を示す模式図である。
【図10】デフォルト状態の量子化テーブルを示す模式図であって、(A)は輝度成分用の量子化テーブル、(B)は色差成分用の量子化テーブルである。
【符号の説明】
1 デジタルカメラ
6 画像処理部
10 制御部
22 CCD(撮像手段)
30 記録部
31 RAM
32 フラッシュメモリ
61 画像データ作成部
62 圧縮画像データ作成部
72 入力ボタン(データサイズ入力手段)
621 縮小画像データ作成部
622 JPEG圧縮部
623 圧縮率決定部
623a 推定画像データサイズ算出部
623b 選択部
623c データサイズ比算出部
623d 圧縮率算出部
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a method for compressing image data, and relates to a method for compressing original image data into JPEG compressed image data of a specified size, a computer-readable recording medium on which an image data compression program is recorded, and a digital still Related to the camera.
[0002]
[Prior art]
Conventionally, a JPEG (Joint Photographic Experts Group) format has been widely used as a file format for irreversibly compressing image data of full-color still images such as photographic images. A JPEG file is generally composed of an image body, a header, and thumbnail data.
When image data is compressed in the JPEG file format (hereinafter, compression in the JPEG file format is referred to as “JPEG compression”), the compression rate is designated, and JPEG compression is performed on the original image data according to the designated compression rate. The
[0003]
[Problems to be solved by the invention]
However, the data size of the image body included in the compressed JPEG file depends on the image quality of the original image. For example, an image with little color change, such as the sky, has a smaller data size of the image body after JPEG compression. On the other hand, for example, an image having a large color change in which a landscape and a person are mixed, such as a commemorative photo, has a large data size of the image body after JPEG compression. That is, even if the data size and compression rate of the image body of the original image are the same, the data size of the image body after JPEG compression is not constant. For this reason, the data size of the image body after JPEG compression cannot be predicted, and even if the compression rate is specified to obtain the desired data size, the data size of the compressed image data and the desired data size are Not equal. As a result, for example, when using a digital still camera, it is difficult to know the number of recordable images in a flash memory or the like used as a recording device.
[0004]
Therefore, it is conceivable to predict the data size of the image body after JPEG compression by setting a standard image and obtaining the relationship between the data size of the image body of the standard image after JPEG compression and the compression ratio. However, when only one standard image is set, there is a problem that the dependency on the image quality of the original image is high, and the difference between the prediction error, that is, the predicted data size and the actual data size after JPEG compression is large. On the other hand, by setting a plurality of standard images, the dependence on image quality decreases. However, when a plurality of standard images are set, the data size indicating the relationship between the data size of the image main body after JPEG compression and the compression ratio increases. For this reason, there is a problem in that the required capacity of the recording apparatus increases and the cost increases. In addition, when a plurality of standard images are set, there is a problem that processing such as selection of a standard image and retrieval of data indicating the relationship between the standard image and the compression rate becomes complicated and high-speed processing becomes difficult.
[0005]
SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to provide a method of compressing image data, which is simple in processing, and has a small difference between a specified compressed data size and a data size after JPEG compression, and a computer-readable recording of an image data compression program. Is to provide a simple recording medium and a digital still camera.
[0006]
[Means for Solving the Problems]
According to the image data compression method of claim 1 and the recording medium on which the image data compression program of claim 6 is recorded, reduced image data is created from the original image data, and the created reduced image data is JPEG compression is performed at a predetermined compression rate. The image data size when the original image data is JPEG compressed is estimated from the data size of the compressed reduced image data. A data size ratio between the estimated estimated image data size and the specified data size is calculated, and an execution compression rate when the original image data is JPEG compressed is determined from the calculated data size ratio. Since there is a correlation between the compressed data size of the reduced image data and the compressed data size of the original image data, the data size of the original image data after JPEG compression at the same compression rate as the reduced image data Can be estimated. By calculating the data size ratio between the estimated estimated image data size and the specified data size, for example, it is possible to determine the optimal compression ratio of the original image data using correlation data between the data size ratio and the execution compression ratio. it can. Therefore, the difference between the designated data size and the data size of the original image data actually compressed can be reduced.
[0007]
Since JPEG compression of reduced image data is processing performed by normal JPEG compression, in addition to this, it is necessary to calculate the estimated image data size, calculate the data size ratio, and determine the execution compression rate. The calculation of the estimated image data size is, for example, a process of multiplying the ratio of the number of pixels with the reduced image data, the calculation of the data size ratio is, for example, a process of dividing the estimated image data size and the designated data size, and determination of the execution compression rate is, for example, All of these are simple processes, such as an operation based on a mathematical expression indicating the correlation between the data size ratio and the execution compression rate, or a search of a table in which the correlation is recorded. Therefore, the compression process of the image data can be executed at a high speed.
[0008]
Further, according to the image data processing method according to claim 1 of the present invention or the recording medium on which the image data compression program according to claim 6 is recorded, the execution compression ratio is determined from the compression ratio calculation table. In the compression rate calculation table, the relationship between the data size ratio and the execution compression rate is set. By using the compression rate calculation table, the execution compression rate can be determined at high speed.
[0009]
According to the image data processing method according to claim 2 or 3 of the present invention or the recording medium on which the image data compression program according to claim 7 or 8 is recorded, the compression rate calculation table stores the data size of the reduced image data after compression. Multiple settings are made according to Therefore, the optimum compression rate can be determined at high speed regardless of the image quality of the original image data. Further, since the data size ratio corresponding to the compression rate from 1 to 100, for example, is set in the compression rate calculation table, the data size is small even if a plurality of compression rate calculation tables are set, and the compression rate calculation table is recorded. Therefore, the capacity of the recording apparatus can be reduced.
[0010]
According to the image data processing method of claim 4 or the recording medium on which the image data compression program of claim 9 is recorded, the estimated image data size is the number of pixels of the original image data and the number of pixels of the reduced image data. It is calculated using the pixel number ratio that is the ratio of. Therefore, the estimated image data size can be calculated regardless of the number of pixels of the original image data.
[0011]
According to the image data processing method according to claim 5 of the present invention or the recording medium on which the image data compression program according to claim 10 is recorded, the estimated image data size is a ratio of the number of pixels to the data size after JPEG compression of the reduced image data. Calculated by multiplying by. Therefore, the estimated image data size can be calculated at high speed.
[0012]
According to the digital still camera of the eleventh aspect of the present invention, the digital still camera includes the data size input means and the compressed image data creation unit. From the data size input means, a designated data size for obtaining a desired data size is input by JPEG compression of the original image data. The compressed image data creation unit compresses the original image data in accordance with the designated image data size input from the input means, and creates compressed image data having the same size as the designated image data size. Therefore, compressed image data having a designated size can be created, and the amount of compressed image data that can be recorded in the recording unit can be easily estimated.
[0013]
DETAILED DESCRIPTION OF THE INVENTION
An example showing an embodiment of the present invention will be described with reference to the drawings.
FIG. 2 shows a digital still camera (hereinafter referred to as “digital camera”) 1 to which an image processing apparatus according to an embodiment of the present invention is applied.
As shown in FIG. 2, the digital camera 1 includes a control unit 10, an image input unit 20, a recording unit 30, a display unit 40, an interface 50, and the like.
[0014]
The control unit 10 processes the electronic data output from the image input unit 20. The control unit 10 includes a CPU (Central Processing Unit) 11, a ROM (Read Only Memory) 12, and an image processing unit 6. The ROM 12 stores computer programs executed by the CPU 11 and the image processing unit 6 of the control unit 10.
[0015]
As shown in FIG. 2, the control unit 10 is connected to an input means for receiving an input from the user. As input means, there are a shutter button 71 to which an instruction to execute photographing is input from a user, operation of various functions of the digital camera 1, and a plurality of input buttons 72 as data size input means. As shown in FIG. 3, the input button 72 is disposed on the back surface of the digital camera 1. From the input button 72, shooting information such as exposure or shutter speed when shooting with the digital camera 1, and desired compressed data size when JPEG compression is performed as the specified data size are input. Is done.
[0016]
As shown in FIG. 2, the image input unit 20 includes a condenser lens 21, a CCD 22 as an imaging unit, and an A / D converter 23. The condensing lens 21 condenses light from the subject on the CCD 22. The CCD 22 has a plurality of pixels, and a plurality of pixels are arranged in a matrix in the horizontal direction and the vertical direction.
[0017]
Each pixel has a color filter disposed on the light receiving surface side. As the color filter, a complementary color filter composed of Cy (Cyan), Mg (Magenta), Ye (Yellow), and G (Green) is used. In the CCD 22, light incident on each image sensor is converted into an electrical signal and output. Since the electrical signal output from the CCD 22 is an analog signal, it is converted into digital electronic data by the A / D converter 23.
[0018]
The recording unit 30 includes a RAM (Random Access Memory) 31 and a flash memory 32. As the RAM 31, a DRAM (Dynamic RAM) having a self-refresh function is used. The flash memory 32 is a rewritable recording medium that can retain recorded contents without being energized, and is built in the digital camera 1 or detachably attached to the digital camera 1.
[0019]
The RAM 31 temporarily records digital electronic data processed by the control unit 10 or output from the A / D converter 23, image data created by the image processing unit 6, and the like. The flash memory 32 accumulates and stores compressed image data created by JPEG compression from image data temporarily recorded in the RAM 31.
[0020]
The display unit 40 includes a liquid crystal display (LCD) 41 and a VRAM (Video RAM) 42. The LCD 41 displays an image based on electronic data recorded in the flash memory 32 or digital electronic data output from the A / D converter 23. Display data created from electronic data for display on the LCD 41 is recorded in the VRAM 42.
The interface 50 outputs the compressed image data recorded in the flash memory 32 to an external device such as a personal computer.
[0021]
As shown in FIG. 4, the image processing unit 6 includes an image data creation unit 61 and a compressed image data creation unit 62. The image data creation unit 61 creates image data by performing exposure correction, color tone correction, white balance adjustment or noise removal on the electronic data output from the CCD 22 and converted into digital data by the A / D converter 23. . The image data created by the image data creation unit 61 is the original image data before JPEG compression. The compressed image data creation unit 62 JPEG compresses the original image data to create compressed image data.
[0022]
Next, the compressed image data creation unit 62 will be described in detail.
As shown in FIG. 5, the compressed image data creation unit 62 includes a reduced image data creation unit 621, a JPEG compression unit 622, and a compression rate determination unit 623. The reduced image data creation unit 621 creates reduced image data from the original image data to be compressed. The JPEG compression unit 622 performs JPEG compression on the original image data and the reduced image data. The compression rate determination unit 623 performs the compression based on the data size of the reduced image data after compression obtained by JPEG compression of the reduced image data (hereinafter, the reduced image data after compression obtained by JPEG compression is referred to as “thumbnail”). The data size when the original image data is JPEG compressed is estimated to determine the compression rate.
[0023]
As shown in FIG. 6, the compression rate determination unit 623 further includes an estimated image data size calculation unit 623a, a selection unit 623b, a data size ratio calculation unit 623c, and a compression rate calculation unit 623d. The estimated image data size calculation unit 623a calculates an estimated data size after compression when the image main body included in the original image data is JPEG compressed from the thumbnail data size. The selection unit 623b selects a predetermined compression rate calculation table from a compression rate calculation table that is set in advance according to the thumbnail data size and recorded in the ROM 12. The data size ratio calculation unit 623c calculates the data size ratio between the designated data size input from the input button 72 and the data size of the estimated image data. The compression rate calculation unit 623d determines a compression rate for compressing the original image data from the compression rate calculation table selected by the selection unit 623b and the data size ratio calculated by the data size ratio calculation unit 623c.
[0024]
Next, processing of image data by the digital camera 1 having the above configuration will be described. The flow of processing for photographing with the digital camera 1 and recording of photographed image data is as shown in FIG.
When the power switch of the digital camera 1 (not shown) is turned on by the user (S100) and the shutter button 71 is pressed, shooting is performed as follows (S200).
[0025]
Light from the subject is condensed on the CCD 22 by the condenser lens 21. In the CCD 22, the condensed light is converted into an electrical signal and output. Since the output electrical signal is an analog signal, it is converted into digital electronic data by the A / D converter 23. This electronic data is created as appropriate image data after various image processing such as color tone and exposure correction and pixel correction or interpolation is performed by the image data creation unit 61 (S300). The created image data is temporarily stored in the RAM 31. The created image data is compressed by the compressed image data creation unit 62 (S400) and recorded in the flash memory 32 (S500).
[0026]
When shooting is completed, the user designates a desired data size from the input button 72 after JPEG compression of the image data. The designated data size is set as the designated data size DSs. The designated data size DSs is determined in advance according to the quality of the captured image. That is, the user does not directly specify the data size after JPEG compression, but selects an image quality such as “standard image quality”, “fine image quality”, or “high definition image quality” using the input button 72. Depending on the image quality, the data size after JPEG compression is determined in advance. The data size determined according to the image quality selected by the user is the designated data size DSs, and JPEG compression is executed using the designated data size DSs as a target value. The image quality, that is, the designated data size DSs can be input from the input button 72 in advance before the shooting is performed, not after the shooting is completed.
[0027]
The JPEG compression process in the compressed image data creation unit 62 will be described. The JPEG compression process is a process in step S400 shown in FIG. The JPEG compression process is performed according to the flow shown in FIG.
In the reduced image data creation unit 621, reduced image data is created from the image data to be compressed among the image data recorded in the RAM 31, that is, the image data of the original image data (S410). Reduced image data is created by thinning out pixels of an image formed from original image data at a predetermined rate. For example, as shown in FIG. 8, when the number of pixels of the image P1 formed from the original image data is about 1.9 million pixels of 1600 × 1200, the number of pixels of the reduced image P2 is about 19000 pixels of 160 × 120. Reduced to The image data of the reduced image P2 is reduced image data.
[0028]
When the reduced image data is created, the reduced image data is sent to the JPEG compression unit 622 and JPEG compressed (S420). The JPEG compression unit 622 compresses the reduced image data based on a preset compression rate Cd and creates a thumbnail. In this embodiment, the compression rate Cd is set to 50%.
[0029]
When the thumbnail is created by the JPEG compression unit 622, the data size of the image body of the thumbnail (hereinafter, the data size of the image body included in the JPEG image data is referred to as “bitstream size”) is sent to the compression rate determination unit 623. It is done. The thumbnail bit stream size sent to the compression rate determination unit 623 is sent to the estimated image data size calculation unit 623a of the compression rate determination unit 623.
[0030]
The estimated image data size calculation unit 623a calculates an estimated bit stream size BSe when the original image data is JPEG compressed from the bit stream size BSr of the thumbnail (S430). The estimated bitstream size BSe is calculated by the following equation (1).
BSe = (P1 / P2) × BSr (1)
[0031]
That is, the estimated bit stream size BSe is calculated by multiplying the thumbnail bit stream size BSr by the ratio of the number of pixels P1 of the original image and the number of pixels P2 of the reduced image.
This is because the ratio between the bit stream size BSr of the thumbnail and the true value BSo of the bit stream size when the original image is JPEG-compressed at the same compression ratio as the thumbnail is the number of pixels P1 of the original image and the number of pixels P2 of the reduced image This is because it is approximated to the ratio of That is, P1: P2≈BSo: BSr. Therefore, in this embodiment, BSe = 100 × BSr.
[0032]
When the estimated bitstream size BSe is calculated, the selection unit 623b selects a compression rate calculation table suitable for the bitstream size BSr of the thumbnail (S440). As shown in FIG. 9, the compression rate calculation table shows the relationship between the data size ratio β and the execution compression rate, and a plurality of compression rate calculation tables are set according to the bit stream size BSr of the thumbnail.
[0033]
In the case as shown in FIG. 9, three compression rate calculation tables are set according to the bit stream size BSr of the thumbnail. The bit stream size BSr of the thumbnail is 0K bytes ≦ BSr <3K bytes when the original image is a flat image with little color change. On the other hand, the bit stream size BSr of the thumbnail is 5 Kbytes ≦ BSr when the original image is an image with a complicated color change. The bit stream size BSr of the thumbnail is 3K bytes ≦ BSr <5K bytes when the original image is an intermediate image between them.
Therefore, the selection unit 623b selects a specific compression rate calculation table from the value of the bit stream size BSr of the thumbnail.
[0034]
The data size ratio calculation unit 623c calculates the data size ratio β (S450). The data size ratio β is a ratio between the designated data size DSs input from the input button 72 and designated, and the estimated bitstream size BSe. That is, it is calculated from the following equation (2).
β = BSe / DSs (2)
For example, when the estimated bit stream size BSe is 200 Kbytes and the specified size is 50 Kbytes, the data size ratio β is 4.
[0035]
When the data size ratio β is calculated, the compression rate calculation unit 623d determines the execution compression rate Ca using the data size ratio β from the compression rate calculation table selected by the selection unit 623b (S460). The effective compression ratio Ca is determined according to the data size ratio β.
For example, when the data size ratio β is 4 and the thumbnail bitstream size BSr is 2 Kbytes, the effective compression ratio Ca is determined to be 10 from FIG.
When the execution compression rate Ca is determined, the JPEG compression unit 622 executes JPEG compression of the image body of the original image data (S470).
[0036]
JPEG compression of the original image data is executed according to the following procedure.
JPEG compression is performed by DCT transformation, quantization, and Huffman transformation, as in the known JPEG compression procedure. Therefore, detailed description thereof will be omitted. Here, a case where JPEG compression is performed at the determined execution compression rate Ca will be described. Normally, when JPEG compression is performed, compression is performed at any stage of DCT transform, quantization, or Huffman transform. In this embodiment, compression is performed by changing the coefficient of the quantization table at the quantization stage.
[0037]
The quantization table in the default state is set as shown in FIG. 10, for example. Two types of quantization tables, one for luminance components and one for color difference components included in image data, are set. When compressing the original image data, each element of the quantization table used for compressing the original image data is calculated based on the following equation (3) from the quantization table in the default state as shown in FIG.
QTB ′ = (QTB × Q + 50) / 100 (3)
Here, QTB is each element of the quantization table, and QTB ′ is each element of the quantization table used when compressing the original image data.
[0038]
Further, the coefficient Q used in the above equation (3) is set by the determined compression rate Ca.
(A) When 1 ≦ Ca <50, Q = 5000 / Ca
(B) When 50 ≦ Ca <100, Q = 200−2 × Ca
(C) When Ca <1, Ca = 1 and Q = 5000
(D) When 100 ≦ Ca, all elements of the quantization table are 1
[0039]
(Compression example 1)
The designated data size DSs is 50 Kbytes, the thumbnail bitstream size BSr is 2 Kbytes, and the estimated bitstream size BSe is 150 Kbytes. At this time, the true value BSo of the bit stream size of the original image data is smaller than the estimated bit stream size BSe.
[0040]
From equation (2), β = 150/50 = 3, and the determined compression rate Ca = 20 is determined from the compression rate calculation table of FIG. Further, since the coefficient Q is calculated as Ca = 20, (A) is used, and Q = 5000/20 = 250. If there are 16 elements in the quantization table in the default state, QTB ′ = (16 × 250 + 50) /100=4.5. The calculation of QTB ′ is performed on all elements of the quantization table in the default state, and the original image data is quantized using the changed quantization table, thereby compressing the original image data.
[0041]
(Compression example 2)
The designated data size DSs is 50 Kbytes, the thumbnail bitstream size BSr is 2 Kbytes, and the estimated bitstream size BSe is 20 Kbytes. At this time, the true value BSo of the bit stream size of the original image data is larger than the estimated bit stream size BSe.
[0042]
From equation (2), β = 20/50 = 0.4, and the determined compression rate Ca = 98 is determined from the compression rate calculation table of FIG. In addition, since the calculation of the coefficient Q is Ca = 98, (B) is used, and Q = 200−2 × 98 = 4. If the number of elements in the default quantization table is 16, then QTB ′ = (16 × 4 + 50) /100=1.14.
[0043]
The JPEG compression process is executed on the original image data by the above process. When the JPEG compression process is completed, the compressed original image data is recorded in the flash memory 32 (S500).
[0044]
As described above, according to the digital camera 1 and the image data compression method executed by the digital camera 1 according to the embodiment of the present invention, a plurality of compression rate calculation tables set according to the bit stream size of thumbnails are provided. Therefore, the dependency of the estimated bit stream size BSe on the image quality of the original image data is low. Therefore, the bit stream size of the original image data can be approximated to the designated data size.
[0045]
In addition to the normal JPEG compression processing, the processing required until compression is the calculation of the estimated bitstream size BSe, the selection of the compression rate calculation table, and the calculation of the data size ratio β, so that the arithmetic processing is simple. Yes, the data size can be estimated quickly.
[Brief description of the drawings]
FIG. 1 is an explanatory diagram showing a flow of JPEG compression, which is image data compression processing using a digital camera according to an embodiment of the present invention.
FIG. 2 is a schematic block diagram showing a digital camera according to an embodiment of the present invention.
FIG. 3 is a rear view showing a digital camera according to an embodiment of the present invention.
FIG. 4 is a block diagram illustrating an image processing unit of a digital camera according to an embodiment of the present invention.
FIG. 5 is a block diagram mainly showing a compressed image data creation unit of a digital camera according to an embodiment of the present invention.
FIG. 6 is a block diagram illustrating a compression rate determination unit of a digital camera according to an embodiment of the present invention.
FIG. 7 is an explanatory diagram showing a flow of image data compression processing using a digital camera according to an embodiment of the present invention.
FIG. 8 is an explanatory diagram showing a relationship between original image data and reduced image data.
FIG. 9 is a schematic diagram illustrating an example of a compression rate calculation table.
10A and 10B are schematic diagrams illustrating a quantization table in a default state, where FIG. 10A is a luminance component quantization table, and FIG. 10B is a color difference component quantization table.
[Explanation of symbols]
1 Digital camera
6 Image processing unit
10 Control unit
22 CCD (imaging means)
30 recording section
31 RAM
32 flash memory
61 Image data generator
62 Compressed image data creation unit
72 Input button (data size input means)
621 Reduced image data creation unit
622 JPEG compression unit
623 Compression ratio determination unit
623a Estimated image data size calculation unit
623b selection unit
623c Data size ratio calculation unit
623d compression rate calculation unit

Claims (11)

元画像データを指定された指定データサイズにJPEG圧縮する画像データの圧縮方法であって、
前記元画像データから縮小画像データを作成する縮小画像データ作成段階と、
前記縮小画像データを所定の圧縮率でJPEG圧縮し、前記縮小画像データのJPEG圧縮後のデータサイズを算出するデータサイズ算出段階と、
前記縮小画像データのJPEG圧縮後のデータサイズから、前記元画像データのJPEG圧縮後の推定画像データサイズを算出する元画像データサイズ推定段階と、
前記推定画像データサイズと前記指定データサイズとのデータサイズ比を算出するデータサイズ比算出段階と、
前記データサイズ比から前記元画像データをJPEG圧縮する際の実行圧縮率を決定する実行圧縮率決定段階であって、前記データサイズ比と前記実行圧縮率との関係が設定されている圧縮率算出テーブルから、前記データサイズ比算出段階で算出された前記データサイズ比を用いて前記実行圧縮率を決定する実行圧縮率決定段階と、
前記元画像データを前記実行圧縮率でJPEG圧縮する本圧縮段階と、
を含むことを特徴とする画像データの圧縮方法。
A method of compressing image data in which original image data is JPEG compressed to a specified data size,
A reduced image data creating step for creating reduced image data from the original image data;
A data size calculating step of JPEG compressing the reduced image data at a predetermined compression rate and calculating a data size after JPEG compression of the reduced image data;
An original image data size estimation step of calculating an estimated image data size after JPEG compression of the original image data from a data size after JPEG compression of the reduced image data;
A data size ratio calculating step of calculating a data size ratio between the estimated image data size and the specified data size;
An execution compression ratio determination step for determining an execution compression ratio when JPEG compressing the original image data from the data size ratio, wherein a compression ratio calculation in which a relationship between the data size ratio and the execution compression ratio is set From the table, an execution compression ratio determination step of determining the execution compression ratio using the data size ratio calculated in the data size ratio calculation step ;
A main compression step of JPEG compressing the original image data at the effective compression rate;
A method for compressing image data.
前記圧縮率算出テーブルは、前記縮小画像データのJPEG圧縮後のデータサイズに応じて複数設定されていることを特徴とする請求項記載の画像データの圧縮方法。The compression ratio calculation table, image data compression method according to claim 1, characterized in that a plurality of sets according to the data size after JPEG compression of the reduced image data. 前記実行圧縮率決定段階では、前記縮小画像データのJPEG圧縮後のデータサイズから特定の圧縮率算出テーブルが選択されることを特徴とする請求項記載の画像データの圧縮方法。 3. The image data compression method according to claim 2, wherein in the execution compression ratio determination step, a specific compression ratio calculation table is selected from a data size after JPEG compression of the reduced image data. 前記元画像データサイズ推定段階では、前記元画像データと前記縮小画像データとの画素数比から前記推定画像データサイズを算出することを特徴とする請求項1、2又は3記載の画像データの圧縮方法。And in the original image data size estimation step, the compression from said pixel number ratio of the original image data and the reduced image data of the image data according to claim 1, 2 or 3, wherein the calculating the estimated image data size Method. 前記縮小画像データのJPEG圧縮後のデータサイズに前記画素数比を乗ずることにより前記推定画像データサイズを算出することを特徴とする請求項記載の画像データの圧縮方法。5. The image data compression method according to claim 4, wherein the estimated image data size is calculated by multiplying the data size after JPEG compression of the reduced image data by the pixel number ratio. 元画像データから指定された指定データサイズへのJPEG圧縮をコンピュータに実行させるための画像データ圧縮プログラムが記録されたコンピュータ読み取り可能な記録媒体であって、
前記元画像データから縮小画像データを作成する縮小画像データ作成手順と、
前記縮小画像データを所定の圧縮率でJPEG圧縮し、前記縮小画像データのJPEG圧縮後のデータサイズを算出するデータサイズ算出手順と、
前記縮小画像データのJPEG圧縮後のデータサイズから、前記元画像データのJPEG圧縮後の推定画像データサイズを算出する元画像データサイズ推定手順と、
前記推定画像データサイズと前記指定データサイズとのデータサイズ比を算出するデータサイズ比算出手順と、
前記データサイズ比から前記元画像データをJPEG圧縮する際の実行圧縮率を決定する実行圧縮率決定手順であって、前記データサイズ比と前記実行圧縮率との関係が設定されている圧縮率算出テーブルから、前記データサイズ比算出段階で算出された前記データサイズ比を用いて前記実行圧縮率を決定する実行圧縮率決定手順と、
前記元画像データを前記実行圧縮率でJPEG圧縮する本圧縮手順と、
をコンピュータに実行させることを特徴とする画像データ圧縮プログラムが記録された記録媒体。
A computer-readable recording medium on which an image data compression program for causing a computer to execute JPEG compression from original image data to a designated data size is recorded,
Reduced image data creation procedure for creating reduced image data from the original image data;
A data size calculation procedure for JPEG compression of the reduced image data at a predetermined compression rate and calculating a data size after JPEG compression of the reduced image data;
An original image data size estimation procedure for calculating an estimated image data size after JPEG compression of the original image data from a data size after JPEG compression of the reduced image data;
A data size ratio calculation procedure for calculating a data size ratio between the estimated image data size and the designated data size;
An execution compression ratio determination procedure for determining an execution compression ratio when JPEG compressing the original image data from the data size ratio, wherein a compression ratio calculation in which a relationship between the data size ratio and the execution compression ratio is set An execution compression ratio determination procedure for determining the execution compression ratio from the table using the data size ratio calculated in the data size ratio calculation step ;
A main compression procedure for JPEG compression of the original image data at the effective compression rate;
A recording medium on which an image data compression program is recorded.
前記圧縮率算出テーブルは、前記縮小画像データのJPEG圧縮後のデータサイズに応じて複数設定されていることを特徴とする請求項記載の画像データ圧縮プログラムが記録された記録媒体。7. The recording medium on which the image data compression program is recorded according to claim 6 , wherein a plurality of the compression rate calculation tables are set according to a data size after JPEG compression of the reduced image data. 前記実行圧縮率決定手順では、前記縮小画像データのデータサイズから特定の圧縮率算出テーブルが選択されることを特徴とする請求項記載の画像データ圧縮プログラムが記録された記録媒体。8. The recording medium on which an image data compression program is recorded according to claim 7 , wherein a specific compression ratio calculation table is selected from the data size of the reduced image data in the execution compression ratio determination procedure. 前記元画像データサイズ推定手順では、前記元画像データと前記縮小画像データとの画素数比から前記推定画像データサイズを算出することを特徴とする請求項6、7又は8載の画像データ圧縮プログラムが記録された記録媒体。9. The image data compression program according to claim 6, 7 or 8, wherein, in the original image data size estimation procedure, the estimated image data size is calculated from a pixel number ratio between the original image data and the reduced image data. Recording medium on which is recorded. 前記縮小画像データのJPEG圧縮後のデータサイズに前記画素数比を乗ずることにより前記推定画像データサイズを算出することを特徴とする請求項記載の画像データ圧縮プログラムが記録された記録媒体。10. The recording medium on which the image data compression program is recorded according to claim 9, wherein the estimated image data size is calculated by multiplying the data size of the reduced image data after JPEG compression by the pixel number ratio. 被写体からの光を電気信号に変換して出力する撮像手段と、
前記撮像手段から出力された電気信号から画像データを作成する画像データ作成部と、
前記画像データを記録可能な記録部と、
前記記録部に記録された元画像データをJPEG圧縮した後の所望の指定データサイズを入力するデータサイズ入力手段と、
前記データサイズ入力手段から入力された前記指定データサイズに応じて前記元画像データから圧縮画像データを作成する圧縮画像データ作成部と、
を備え
前記圧縮画像データ作成部は、前記元画像データから縮小画像データを作成する縮小画像データ作成手段と、前記元画像データおよび前記縮小画像データをJPEG圧縮するJPEG圧縮手段と、前記JPEG圧縮手段で圧縮された縮小画像データサイズから前記元画像データを前記指定データサイズにJPEG圧縮したときの推定画像データサイズを算出し圧縮率を決定する圧縮率決定手段とを有
前記JPEG圧縮手段は前記縮小画像データを所定の圧縮率で圧縮し、
前記圧縮率決定手段は、前記推定画像データサイズを算出する推定画像データサイズ算出手段と、複数設定されている圧縮率算出テーブルから前記推定画像データサイズに応じて特定の圧縮率算出テーブルを選択する選択手段と、前記推定画像データサイズと前記指定データサイズとのデータサイズ比を算出するデータサイズ比算出手段と、前記選択手段で選択された前記特定の圧縮率算出テーブルと前記データサイズ比算出手段で算出された前記データサイズ比とから前記元画像データを圧縮するときの圧縮率を決定する圧縮率決定手段とを有することを特徴とするデジタルスチルカメラ。
Imaging means for converting light from a subject into an electrical signal and outputting the electrical signal;
An image data creation unit for creating image data from the electrical signal output from the imaging means;
A recording unit capable of recording the image data;
A data size input means for inputting a desired designated data size after JPEG compression of the original image data recorded in the recording unit;
A compressed image data creation unit that creates compressed image data from the original image data according to the designated data size input from the data size input means;
Equipped with a,
The compressed image data creation unit includes reduced image data creation means for creating reduced image data from the original image data, JPEG compression means for JPEG compression of the original image data and the reduced image data, and compression by the JPEG compression means is the original image data from the reduced image data size to have a compression ratio determining means for determining a calculated compression ratio estimation image data size when the JPEG compression in the designated data size,
The JPEG compression means compresses the reduced image data at a predetermined compression rate,
The compression rate determination unit selects a specific compression rate calculation table according to the estimated image data size from a plurality of set compression rate calculation tables and an estimated image data size calculation unit that calculates the estimated image data size. Selecting means; data size ratio calculating means for calculating a data size ratio between the estimated image data size and the designated data size; the specific compression ratio calculating table selected by the selecting means; and the data size ratio calculating means. A digital still camera, comprising: a compression rate determining unit that determines a compression rate when compressing the original image data from the data size ratio calculated in step (1).
JP2000283345A 2000-09-19 2000-09-19 Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera Expired - Fee Related JP3988371B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000283345A JP3988371B2 (en) 2000-09-19 2000-09-19 Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000283345A JP3988371B2 (en) 2000-09-19 2000-09-19 Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera

Publications (2)

Publication Number Publication Date
JP2002094800A JP2002094800A (en) 2002-03-29
JP3988371B2 true JP3988371B2 (en) 2007-10-10

Family

ID=18767720

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000283345A Expired - Fee Related JP3988371B2 (en) 2000-09-19 2000-09-19 Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera

Country Status (1)

Country Link
JP (1) JP3988371B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4721039B2 (en) * 2005-03-09 2011-07-13 富士フイルム株式会社 Image processing method and apparatus
JP2008028534A (en) 2006-07-19 2008-02-07 Pentax Corp Digital camera
KR100888986B1 (en) * 2007-05-30 2009-03-17 김원섭 Method and Device for Setting Compression Rate of Image and Record Medium for the Same
JP5167385B2 (en) * 2011-06-16 2013-03-21 ペンタックスリコーイメージング株式会社 Digital camera

Also Published As

Publication number Publication date
JP2002094800A (en) 2002-03-29

Similar Documents

Publication Publication Date Title
JP4284448B2 (en) Image processing apparatus and method
JP4008778B2 (en) Imaging device
JP4126721B2 (en) Face area extraction method and apparatus
JP4869149B2 (en) Image data compression apparatus, image data compression method and program
JP4730553B2 (en) Imaging apparatus and exposure control method
US20090009659A1 (en) Image capturing apparatus and method
JP2004128985A (en) Imaging system and program, and reproduction system and program
JP2002199410A (en) Imaging device, compensating processing method for deteriorated image and storage medium
JP4239234B2 (en) Electronic still camera
US6256414B1 (en) Digital photography apparatus with an image-processing unit
JP2004201228A (en) Method and device for extracting face area
JP3809818B2 (en) Image processing method, recording medium, and image processing apparatus
JP3988371B2 (en) Image data compression method, computer-readable recording medium on which image data compression program is recorded, and digital still camera
JP4407055B2 (en) Electronic camera
JP4123352B2 (en) Movie imaging device and movie playback device
JP2008219271A (en) Image processor, image processing method and photographing device
US7551204B2 (en) Imaging apparatus having a color image data measuring function
JP4306687B2 (en) Image processing method, image processing program, and image processing apparatus
JP3115912B2 (en) Image recording device
EP0998130B1 (en) Digital camera and image processing method
KR20100011288A (en) Method of compressing images, computer-readable medium storing program to perform the same and apparatus of photographing digital images
JP2010124114A (en) Digital camera and image data processing program
WO2006109703A1 (en) Imaging system and video signal processing program
JP2003274245A (en) Imaging device
JP3752931B2 (en) Digital camera and image data processing method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040922

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060814

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060818

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20061010

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20061222

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20061226

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070626

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070709

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

Free format text: PAYMENT UNTIL: 20100727

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110727

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20110727

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120727

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20120727

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20130727

Year of fee payment: 6

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees