JP4701065B2 - Image processing apparatus and image processing method - Google Patents
Image processing apparatus and image processing method Download PDFInfo
- Publication number
- JP4701065B2 JP4701065B2 JP2005302160A JP2005302160A JP4701065B2 JP 4701065 B2 JP4701065 B2 JP 4701065B2 JP 2005302160 A JP2005302160 A JP 2005302160A JP 2005302160 A JP2005302160 A JP 2005302160A JP 4701065 B2 JP4701065 B2 JP 4701065B2
- Authority
- JP
- Japan
- Prior art keywords
- image data
- compression
- histogram
- decompression
- image
- 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
Links
Images
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Description
本発明は画像処理装置及び画像処理方法に関し、特に、画像を非可逆圧縮する画像処理装置及び画像処理方法に関する。 The present invention relates to an image processing apparatus and an image processing method, and more particularly to an image processing apparatus and an image processing method for irreversibly compressing an image.
画像処理装置であるデジタルカメラは、一般的に、撮像した画像(以下、「撮像画像」と呼ぶ)に輝度補正やホワイトバランス処理などを施した後、JPEG符号化などの非可逆圧縮を施し、記憶媒体に記録する。 A digital camera that is an image processing apparatus generally performs brightness correction, white balance processing, and the like on a captured image (hereinafter referred to as “captured image”), and then performs irreversible compression such as JPEG encoding. Record on a storage medium.
撮像画像を非可逆圧縮すると、撮像画像のデータサイズは小さくなるが、画像品質(以下、「画質」と呼ぶ)は低下する。さらに、圧縮率を高くすればするほどデータサイズはさらに小さくなるが、画質はさらに低下する。したがって、データサイズを小さくすることと画質を向上させることの間にはトレードオフの関係がある。JPEG符号化に際して、データサイズと画質を決定するパラメータ(以下、「圧縮パラメータ」と呼ぶ)として、量子化テーブルが用いられる。しかし、データサイズを極力小さくしつつ、ユーザの満足する画質を得るために適切な圧縮パラメータをユーザ自身が決定することは、困難である。 When the captured image is irreversibly compressed, the data size of the captured image is reduced, but the image quality (hereinafter referred to as “image quality”) is degraded. Furthermore, the higher the compression ratio, the smaller the data size, but the image quality further decreases. Therefore, there is a trade-off relationship between reducing the data size and improving the image quality. In JPEG encoding, a quantization table is used as a parameter for determining data size and image quality (hereinafter referred to as “compression parameter”). However, it is difficult for the user himself / herself to determine appropriate compression parameters in order to obtain image quality that satisfies the user while minimizing the data size.
この問題に関して、特許文献1は、サイズ一定モードと画質一定モードの2つの符号化モードを備えるデジタルカメラを開示する。特許文献1のデジタルカメラによれば、符号化モードがサイズ一定モードの場合、JPEG符号化に際して、撮像画像が一定の範囲内のデータサイズとなるような圧縮パラメータが使用される。一方、符号化モードが画質一定モードの場合、JPEG符号化に際して、撮像画像の画質が一定の範囲内の品質になるような圧縮パラメータが使用される。
しかしながら、特許文献1のデジタルカメラは、撮像画像を画質一定モードでJPEG符号化する場合、固定された特定の圧縮パラメータを使用するが、符号化後の撮像画像の画質を定量的に評価することができない。そのため、撮像画像の画質が実際にユーザの望む水準以上であることが保証されない。 However, the digital camera of Patent Document 1 uses a fixed specific compression parameter when JPEG encoding a captured image in the constant image quality mode, but quantitatively evaluates the image quality of the captured image after encoding. I can't. Therefore, it is not guaranteed that the image quality of the captured image is actually higher than the level desired by the user.
本発明はこのような状況に鑑みてなされたものであり、ユーザが圧縮パラメータを決定する必要無しに、画質が一定水準以上となるように画像を非可逆圧縮する技術を提供することを目的とする。 The present invention has been made in view of such a situation, and an object of the present invention is to provide a technique for irreversibly compressing an image so that the image quality becomes a certain level or more without the need for a user to determine a compression parameter. To do.
上記課題を解決するために、本発明の画像処理装置は、圧縮パラメータに基づいて所定の圧縮率で第1の画像データを非可逆圧縮して第2の画像データを生成する圧縮手段と、前記第2の画像データを伸長して第3の画像データを生成する伸長手段と、前記第3の画像データから、輝度成分及び複数の色成分のうち少なくともいずれか1成分に対応するヒストグラムを生成する生成手段と、前記生成手段によりヒストグラムが生成されると、当該ヒストグラムの各階級について隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更する変更手段と、を備え、前記変更手段により前記圧縮率が変更された場合、変更された圧縮率での前記圧縮手段による非可逆圧縮、当該非可逆圧縮により生成された画像データの前記伸長手段による伸長、及び当該伸長により生成された画像データに関する前記生成手段によるヒストグラムの生成を再度行うことを特徴とする。 In order to solve the above problems, an image processing apparatus according to the present invention includes: a compression unit configured to generate second image data by irreversibly compressing first image data at a predetermined compression rate based on a compression parameter; A decompression unit that decompresses the second image data to generate third image data, and generates a histogram corresponding to at least one of a luminance component and a plurality of color components from the third image data. When the histogram is generated by the generation unit and the generation unit, the number of classes whose frequency change rate from the adjacent class exceeds a predetermined ratio for each class of the histogram is greater than a predetermined number. , and a changing means for changing the compression ratio, when the compression ratio is changed by the changing means, lossy compression by the compression means in the modified compression ratio, the irreversible Extended by the extension means of the image data generated by condensation, and is characterized in that for generating a histogram again by the generating means to an image data generated by the extension.
また、本発明の画像処理方法は、圧縮パラメータに基づいて所定の圧縮率で第1の画像データを非可逆圧縮して第2の画像データを生成する圧縮工程と、前記第2の画像データを伸長して第3の画像データを生成する伸長工程と、前記第3の画像データから、輝度成分及び複数の色成分のうち少なくともいずれか1成分に対応するヒストグラムを生成する生成工程と、前記生成工程によりヒストグラムが生成されると、当該ヒストグラムの各階級について隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更する変更工程と、を備え、前記変更工程により前記圧縮率が変更された場合、変更された圧縮率での前記圧縮工程による非可逆圧縮、当該非可逆圧縮により生成された画像データの前記伸長工程による伸長、及び当該伸長により生成された画像データに関する前記生成工程によるヒストグラムの生成を再度行うことを特徴とする。 The image processing method of the present invention includes a compression step of irreversibly compressing the first image data at a predetermined compression rate based on a compression parameter to generate the second image data, and the second image data Decompression step of decompressing and generating third image data, generation step of generating a histogram corresponding to at least one of a luminance component and a plurality of color components from the third image data, and the generation When a histogram is generated by the process, the compression ratio is changed when the number of classes whose frequency change from an adjacent class exceeds a predetermined ratio is greater than a predetermined number for each class of the histogram. comprising a changing step of, the, if the compression ratio by said changing step is changed, the non-reversible compression by the compression process in the modified compression ratio, generated by the lossy compression And performing elongation by the stretching process of the image data, and the generation of the histogram by the generating step to an image data generated by the extension again.
なお、その他の本発明の特徴は、添付図面及び以下の発明を実施するための最良の形態の記載によっていっそう明らかになるものである。 Other features of the present invention will become more apparent from the accompanying drawings and the following description of the best mode for carrying out the invention.
以上の構成により、本発明によれば、ユーザが圧縮パラメータを決定する必要無しに、画質が一定水準以上となるように画像を非可逆圧縮することが可能となる。 With the above configuration, according to the present invention, it is possible to perform irreversible compression of an image so that the image quality becomes a certain level or more without the need for the user to determine a compression parameter.
以下、添付図面を参照して、本発明の上位概念、中位概念および下位概念の理解に役立つ実施形態を示す。なお、以下の実施形態に含まれる概念について、そのすべてが特許請求の範囲に記載されているとは限らない。ただし、これは特許発明の技術的範囲から意識的に除外したのではないことを理解していただきたい。 DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments useful for understanding the general concept, intermediate concept, and subordinate concept of the present invention will be described below with reference to the accompanying drawings. Note that not all of the concepts included in the following embodiments are described in the claims. However, it should be understood that this is not intentionally excluded from the technical scope of the patented invention.
[第1の実施形態]
<デジタルカメラ100の構成>
図1は、本発明を適用する画像処理装置である、デジタルカメラ100の構成を示す機能ブロック図である。
[First Embodiment]
<Configuration of
FIG. 1 is a functional block diagram showing a configuration of a
レンズユニット10は、光学レンズ、ズーム機構、絞り機構などから構成され、入射
した光を撮像素子12に結像させる。
The
撮像素子12は、光信号をアナログ電気信号に変換するものであり、例えばCCD(電荷結合素子)である。
The
A/D変換器14は、撮像素子12が出力したアナログ電気信号をデジタル電気信号に変換するものである。このデジタル電気信号は、圧縮前の撮像画像データである。A/D変換器14から出力される画像データは、画像処理回路20およびメモリ制御回路18を介して、或いは画像処理回路20を介することなくメモリ制御回路18のみを介して、メモリ22又は記憶媒体24に記録される。
The A /
タイミング発生回路16は、撮像素子12、A/D変換器14、D/A変換器30にクロック信号や制御信号を供給するタイミング発生回路であり、システム制御部50により制御される。
The
メモリ制御回路18は、A/D変換器14、画像処理回路20、メモリ22、記憶媒体24、圧縮・伸長回路26、ヒストグラム取得回路28、D/A変換器30の間におけるデータ転送の制御を行う。
The
画像処理回路20は、A/D変換器14から出力される画像データ、又は、メモリ制御回路18から出力される画像データに対して、例えば、画像補間処理や色変換処理、変倍処理等の画像処理を施す。
The
メモリ22は、撮像画像データに対する画像処理時や圧縮・伸長時の作業領域として使用したり、画像表示部32に表示する画像データを格納するために使用したりするメモリであり、デジタルカメラ100に内蔵されている。メモリ22は、所定枚数の静止画像や所定時間の動画像を格納するために十分な記憶容量を備えている。また、メモリ22は、システム制御部50の作業領域としても使用されうる。
The
記憶媒体24は、画像データを記録するためのものである。記憶媒体24には、半導体メモリ(例えばメモリカード)や磁気ディスク(例えばハードディスク)などが使用され、デジタルカメラ100に内蔵されているものもあれば、着脱可能なものもある。
The
圧縮・伸長回路26は、例えばJPEG符号化により画像データを圧縮したり、圧縮された画像データを伸長したりする。圧縮・伸長回路26は、メモリ22又は記憶媒体24に格納されている画像データを読み込んで、圧縮処理又は伸長処理を行い、処理済みの画像データをメモリ22及び記憶媒体24のうち少なくとも一方に書き込む。
The compression /
ヒストグラム取得回路28は、圧縮・伸長回路26によって圧縮された後に再度伸長されてメモリ22に格納されている画像データを読み込み、画像データの輝度や所定色の度数分布を取得してヒストグラムを生成し、保持する。なお、ヒストグラム取得回路28が読み込む画像データは、圧縮・伸長回路26によって圧縮された後に再度伸長された画像データ(すなわち、画質がある程度低下している画像データ)である。ヒストグラム取得回路28の詳細は、図2を参照して後にさらに説明する。
The
D/A変換器30は、デジタル電気信号(すなわち画像データ)をアナログ電気信号に変換する。
The D /
画像表示部32は、例えば、TFT LCD等で構成される。メモリ22に書き込まれた表示用の画像データは、D/A変換器30を介して画像表示部32に供給され、画像表示部32によって表示される。
The
また、レンズユニット10が捉えた画像を画像表示部32に逐次表示することにより、電子ビューファインダ(EVF)機能を実現することができる。さらに、画像表示部32には、撮像に必要な情報表示、例えば合焦表示、手振れ警告表示、フラッシュ充電表示、シャッタースピード表示、絞り値表示、露出補正表示等を行うことができる。
In addition, by sequentially displaying images captured by the
この他にも、画像表示部32は、撮像画像のいわゆるレックビュー表示を行ったり、画像データの撮像情報、輝度又は所定色のヒストグラム情報を画像データと同時に表示したりする、情報表示付き再生機能を実現可能に構成されてもよい。
In addition to this, the
また、画像表示部32には、圧縮処理された画像データの画質が所定の水準以下である場合に警告を表示したり、ユーザが圧縮パラメータを設定する為のメニューを表示したりすることもできる。
The
光学ファインダ34は、画像表示部32によるEVF機能を使用することなしに撮像を行うことを可能にする。また、光学ファインダ34内には、画像表示部32による撮像に必要な情報表示(すなわち、合焦表示、手振れ警告表示、フラッシュ充電表示、シャッタースピード表示、絞り値表示、露出補正表示等)と同様の表示を行うための素子が設置されている。
The
フラッシュ36は、暗所における撮像時に投光を行う。フラッシュ36はまた、AF(オートフォーカス)補助光の投光機能やフラッシュ調光機能も有する。
The
レンズ制御部38はレンズユニット10の制御部であり、システム制御部50の指示に従ってレンズユニット10の焦点制御、ズーム制御、絞り値、シャッタースピードの制御等を行う。
The
モードダイアル40は、ユーザがデジタルカメラ100の動作モードを選択するために使用される。これによりユーザは、電源オフ、自動撮像モード、マニュアル撮像モード、パノラマ撮像モード、再生モード、動画モード、等の各機能モードを選択することができる。
The mode dial 40 is used for the user to select an operation mode of the
シャッタースイッチ42は、シャッターボタン44の操作途中(半押し)で、AF処理、AE(自動露出)処理、AWB(オートホワイトバランス)処理、EF(フラッシュプリ発光)処理等の動作の開始をシステム制御部50に指示する。
The
また、シャッタースイッチ42は、シャッターボタン44の操作完了(全押し)で、一連の撮像・記録処理の開始をシステム制御部50に指示する。撮像・記録処理においては、まず、撮像素子12から出力されるアナログ信号がA/D変換器14によりデジタル信号すなわち画像データに変換される。この画像データは、メモリ制御回路18を介してメモリ22に格納され、メモリ制御回路18を介して画像処理回路20において画像処理され、メモリ制御回路18を介して圧縮・伸長回路26において圧縮処理される。次いで、圧縮処理された画像データは、メモリ制御回路18を介してメモリ22から読み出され、記憶媒体24へ書き込まれる。
The
表示切替スイッチ46は、画像表示部32の表示を制御するために使用される。撮像時においては、表示切替スイッチ46が押されると、画像表示部32を利用したEVF機能の、ON/OFFを切り替える指示がシステム制御部50になされる。再生時においては、表示切替スイッチ46が押されると、情報表示付き再生機能のON/OFFを切り替える指示がシステム制御部50になされる。
The
セレクトボタン48は、ユーザが画像表示部32に表示されるメニューに従って、圧縮パラメータの選択を行い、システム制御部50に選択された圧縮パラメータを通知するために使用される。
The
システム制御部50は、メモリ52に格納されているプログラム(ファームウェア)を実行することにより、デジタルカメラ100全体を制御する。例えば、システム制御部50は、圧縮・伸長回路26に対して圧縮パラメータの指示を行う。また、ヒストグラム取得回路28で取得した画像データのヒストグラム解析情報を取得し、ヒストグラム解析情報に基づいてデジタルカメラ100の制御を行う。
The
メモリ52は、システム制御部50が実行するファームウェアや、システム制御部50がファームウェアを実行する際に参照する定数、変数、圧縮パラメータ等を記憶する。
The
電源制御部60は、例えば電池検出回路、DC−DCコンバータ、通電するブロックを切り替えるスイッチ回路等により構成される。電源制御部60は、電池装着の有無、電池の種類及び電池残量を検出し、その検出結果及びシステム制御部50の指示に基づいてDC−DCコンバータを制御して、必要な電圧を必要な期間だけデジタルカメラ100の各構成要素に供給する。
The
コネクタ62は、電源制御部60と電源部64を接続する。
The
電源部64は、例えばアルカリ電池やリチウム電池等の一次電池、Li電池等の二次電池、ACアダプタ等で構成され、デジタルカメラ100に電力を供給する。
The
図2は、ヒストグラム取得回路28の詳細な構成を示す機能ブロック図である。
FIG. 2 is a functional block diagram showing a detailed configuration of the
色空間変換回路202は、YUV色空間により表現される画像データ(以下、「YUVデータ」と呼ぶ)をRGB色空間により表現される画像データ(以下、「RGBデータ」と呼ぶ)に変換する。色空間変換回路202は、圧縮・伸長回路26によって伸長されてメモリ22に格納されているYUVデータを、メモリ制御回路18を介して取得し、システム制御部50から指示される変換式に従ってRGBデータへ変換する。
The color
セレクタ204は、システム制御回路50の指示に従い、メモリ制御回路18から入力されるYUVRGBの各成分から、ヒストグラムを生成する対象の成分を選択する。
The
積分回路206は、セレクタ204からの入力に応じて、RAM208の読み出しアドレスを決定し、データの読み出しを行う。積分回路206は読み出した値をインクリメントし、積分回路206の同一アドレスへインクリメント後の値を書き戻す。
The
ここで、積分回路206は、画像データのすべての画素に対して上述の処理を行う。例えば、画像データが横1600画素×縦1200画素=約200万画素の場合を考える。積分回路206は、約200万のすべての画素について、以下の(1)〜(4)の処理を行う。
(1)輝度を判定する。
(2)RAM208の、(1)で判定された輝度に対応するアドレスから、度数を読み出す。
(3)(2)で読み出した度数をインクリメントする。
(4)(3)でインクリメントした値を、(2)で読み出したRAM208のアドレスに書き込む。
Here, the
(1) The brightness is determined.
(2) The frequency is read from the address of the
(3) The frequency read in (2) is incremented.
(4) The value incremented in (3) is written to the address of the
RAM208は、メモリ制御回路18から入力されるYUVRGBの各成分のうち少なくともいずれかに関するヒストグラムを保持するためのものである。システム制御部50は、RAM208の保持するヒストグラムを読み出したり、消去したりすることができる。
The
RAM208は、保持するヒストグラムの数及び分解能に応じたアドレス空間を必要とする。例えば、Y成分を256階調で表現する1個のヒストグラムを保持する場合には、8ビットのアドレス空間が必要となる(2の8乗は256であるため)。
The
<ヒストグラムの解析と画質の判定>
図3及び図4を参照して、システム制御部50がヒストグラム取得回路28から取得したヒストグラムを元に、圧縮された画像データの画質が所定の水準以上であるか否かを判定する処理の概要を説明する。なお、以下では画像データの輝度(Y成分)にのみ注目して説明するが、RGBの各成分に関しても同様のことが言える。また、輝度を256階調として説明するが、これに限られず、例えば1024階調などでもよい。
<Histogram analysis and image quality determination>
Referring to FIGS. 3 and 4, an outline of processing for determining whether the image quality of the compressed image data is equal to or higher than a predetermined level based on the histogram acquired by the
図3は、ヒストグラム取得回路28が、圧縮・伸長回路26により圧縮された後に再度伸長された画像データのY成分を元に生成したヒストグラムの一例を示す図である。
FIG. 3 is a diagram showing an example of a histogram generated by the
図3(a)は、画質劣化が小さく、画質が所定の水準以上である画像データから生成された、輝度のヒストグラムである。図3(b)は、画質劣化が大きく、画質が所定の水準未満の画像データから生成された、輝度のヒストグラムである。画質劣化が大きいということは、圧縮パラメータに含まれる量子化テーブルの値が大きすぎた、すなわち圧縮率が高すぎたということを意味する。 FIG. 3A is a luminance histogram generated from image data with small image quality deterioration and image quality of a predetermined level or higher. FIG. 3B is a luminance histogram generated from image data having a large image quality deterioration and an image quality less than a predetermined level. The large image quality degradation means that the value of the quantization table included in the compression parameter is too large, that is, the compression rate is too high.
本来の自然画像に近い、画質劣化の少ない画像データにおいては、輝度のヒストグラムは図3(a)に示すように緩やかに変化する。しかし、過度に高い圧縮率で圧縮したために画像品質が低下した画像データにおいては、輝度のヒストグラムは図3(b)に示すように急激に変化する。 In image data that is close to the original natural image and has little image quality deterioration, the luminance histogram changes gently as shown in FIG. However, in image data whose image quality has deteriorated due to compression at an excessively high compression rate, the luminance histogram changes abruptly as shown in FIG.
図4は、図3で示したヒストグラムの輝度に関する隣接度数変化の割合を示す図である。隣接度数変化の割合は、次式で定義される。
(隣接度数変化の割合)=ヒストグラム[n]/ヒストグラム[n−1]×100
ただし、nは輝度であり、n=1,2,3,...,255である。また、ヒストグラム[n]は、輝度nの度数を示す。
FIG. 4 is a diagram showing the ratio of the adjacent frequency change related to the luminance of the histogram shown in FIG. The ratio of the adjacent frequency change is defined by the following equation.
(Rate of adjacent frequency change) = Histogram [n] / Histogram [n−1] × 100
However, n is a brightness | luminance and n = 1, 2, 3,. . . , 255. The histogram [n] indicates the frequency of the brightness n.
図4(a)に示すように、ヒストグラムが緩やかに変化する場合(画質劣化が小さい場合)の隣接度数変化の割合は、ほぼ100%付近で緩やかに推移する。すなわち、隣接する輝度同士の度数が急激に変化することは少ない。一方、図4(b)に示すようにヒストグラムが激しく変化する場合(画質劣化が大きい場合)の隣接度数変化の割合は、大きく振動する。 As shown in FIG. 4A, the rate of change in the adjacent frequency when the histogram changes gently (when image quality deterioration is small) changes gently around approximately 100%. That is, the frequency between adjacent luminances rarely changes abruptly. On the other hand, as shown in FIG. 4B, when the histogram changes drastically (when image quality deterioration is large), the ratio of the adjacent frequency change greatly fluctuates.
システム制御部50は、所定の隣接度数変化の割合を超える階級のカウント(数え上げ)を行い、カウント数が、所定の閾値を超えた場合には、画質が所定の水準未満であると判定することができる。「所定の隣接度数変化の割合」及び「所定の閾値」は、メモリ52に事前に記録されていてもよいし、ユーザがセレクトボタン48等を操作して設定・変更可能なようにデジタルカメラ100を構成してもよい。
The
例えば、図4において、所定の隣接度数変化の割合を200%に設定した場合、200%を超える階級の数は、
図4(a)−−− 4個
図4(b)−−−38個
となり、カウント数の所定の閾値を30に設定した場合には、図4(b)に対応する画像データは、画質が所定の水準未満であると判定される。
For example, in FIG. 4, when the ratio of the predetermined adjacency frequency change is set to 200%, the number of classes exceeding 200% is
4 (a) --- 4 pieces Fig. 4 (b) --- 38 pieces
Thus, when the predetermined threshold value of the count number is set to 30, the image data corresponding to FIG. 4B is determined to have an image quality less than a predetermined level.
なお、輝度の階調数が大きくなるほど所定の閾値も大きく設定されることが好ましい。なぜなら、輝度が256階調の場合は例えば30という値は比較的大きな値であるが、輝度が1024階調の場合は30という値は極めて小さいからである。また、所定の閾値を輝度の階調数に対する割合に基づいて設定してもよい。割合を10%に設定すると、所定の閾値は256階調の10%、すなわち約26となる。 Note that it is preferable that the predetermined threshold value be set larger as the number of gradations of luminance increases. This is because, for example, a value of 30 is a relatively large value when the luminance is 256 gradations, but a value of 30 is extremely small when the luminance is 1024 gradations. Further, the predetermined threshold value may be set based on a ratio of luminance to the number of gradations. When the ratio is set to 10%, the predetermined threshold value is 10% of 256 gradations, that is, about 26.
また、前述のように、システム制御部50はY成分以外に基づいて画質の判定を行ってもよい。例えば、システム制御部50はG成分について上記と同様の処理を行ってもよいし、RGBの3成分について上記と同様の処理を行ってもよい。
Further, as described above, the
複数の成分について上記と同様の処理を行う場合、そのうち1つの成分について、隣接度数変化の割合が所定の割合を超える階級の数が所定の閾値を超える場合に、システム制御部50は画質が所定の水準未満であると判定できる。或いは、すべての成分について又は所定数以上の成分について、隣接度数変化の割合が所定の割合を超える階級の数が所定の閾値を超える場合に、システム制御部50は画質が所定の水準未満であると判定することとしてもよい。
When the same processing as described above is performed for a plurality of components, the
<撮像・記録処理の流れ>
図5は、第1の実施形態における、デジタルカメラ100による撮像・記録処理の流れを示すフローチャートである。システム制御部50は、図5のフローチャートに従い、JPEG符号化した画像データの画質を確認し、画質が所定の水準未満の場合は圧縮パラメータを変更してJPEG符号化を繰り返すことにより、画質が所定の水準以上になるようにする。
<Flow of imaging / recording process>
FIG. 5 is a flowchart illustrating the flow of the imaging / recording process performed by the
ステップS501で、画像処理回路20は、A/D変換器14及びメモリ制御回路18を介してメモリ22に格納された画像データを、メモリ制御回路18を介して読み込む。
In step S <b> 501, the
ステップS502で、画像処理回路20は、ステップS501で読み込んだ画像データに対して画像補間処理や色変換処理等の画像処理を行う。
In step S502, the
ステップS503で、画像処理回路20は、ステップS502で画像処理を施した画像データに対して、設定及び用途に応じた変倍処理を行う。設定及び用途とは、例えば撮像画像をラージサイズ/ミドルサイズ/スモールサイズのいずれのサイズで記録するかという設定や、サムネイル画像としての用途を意味する。
In step S503, the
ステップS504で、画像処理回路20は、ステップS502及びS503で画像処理を施した画像データを、メモリ制御回路18を介してメモリ22に書き込む。
In step S504, the
ステップS505で、圧縮・伸長回路26は、メモリ制御回路18を介してメモリ22からステップS504で書き込まれた画像データを読み込み、離散コサイン変換(DCT変換)及び量子化処理を行う。量子化処理に際して、圧縮・伸長回路26は、メモリ52に格納されている圧縮パラメータに含まれる量子化テーブルを使用する。
In step S505, the compression /
ステップS506で、圧縮・伸長回路26は、ハフマン符号化処理を行う。
In step S506, the compression /
ステップS507で、圧縮・伸長回路26は、ステップS505及びS506で処理された(すなわちJPEG符号化された)画像データを、メモリ制御回路18を介してメモリ22に書き込む。
In step S507, the compression /
ステップS508で、圧縮・伸長回路26は、ステップS507で書き込まれた画像データを、メモリ制御回路18を介してメモリ22から読み込む。
In step S508, the compression /
ステップS509で、圧縮・伸長回路26は、ステップS508で読み込んだ画像データに対して逆量子化処理及び逆離散コサイン変換(逆DCT変換)を行い、伸長された画像データを得る。
In step S509, the compression /
ステップS510で、ヒストグラム取得回路28は、ステップS509で伸長された画像データの所定の成分(ここではY成分とする)からヒストグラムを生成する。
In step S510, the
ステップS511で、システム制御部50は、ステップS510で生成されたヒストグラムの解析を行う。
In step S511, the
ステップS512で、システム制御部50は、ヒストグラムの解析結果に基づき、ステップS507でメモリ22に書き込まれた画像データの画質が所定の水準以上であるか否かを判定する。
In step S512, the
ステップS511及びS512におけるヒストグラムの解析及び画質の判定は、図3及び図4を参照して前述したように行われる。 The histogram analysis and the image quality determination in steps S511 and S512 are performed as described above with reference to FIGS.
ステップS512において、画質が所定の水準以上であると判定された場合はステップS514に進み、そうでない場合はステップS513に進む。 If it is determined in step S512 that the image quality is equal to or higher than the predetermined level, the process proceeds to step S514, and if not, the process proceeds to step S513.
ステップS513で、システム制御部50は、圧縮パラメータを変更する。具体的には、圧縮率が下がるように量子化テーブルの値を小さくする。次いでステップS505に戻り、デジタルカメラ100は画質が所定の水準以上となるまで同様の処理を繰り返す。
In step S513, the
ステップS514で、システム制御部50は、ステップS507でメモリ22に書き込まれた画像データを、メモリ制御回路18を介して記憶媒体24に記録する。
In step S514, the
<第1の実施形態のまとめ>
以上説明したように、本実施形態によれば、デジタルカメラ100は撮像した画像データを所定の圧縮パラメータを用いて圧縮し、圧縮した画像データを伸長する。デジタルカメラ100は伸長した画像データの画質が所定の水準以上であるか否かを判定し、所定の水準以上でない場合は圧縮パラメータを変更して、画質が所定の水準以上になるまで圧縮処理を繰り返す。
<Summary of First Embodiment>
As described above, according to the present embodiment, the
これにより、本実施形態のデジタルカメラ100によれば、ユーザが圧縮パラメータを決定する必要無しに、画質が一定水準以上となるように画像を非可逆圧縮(ここではJPEG符号化)することが可能となる。
As a result, according to the
なお、本実施形態の説明において、RAM208の容量には言及してこなかったが、RAM208の1ワードあたりの容量は、メモリ制御回路18から入力される画像データのサイズに対して、十分な容量でなければならない。例えば、画像データが横1600画素×縦1200画素=約200万画素の場合、1つの階調に最大約200万の値が格納される可能性があるため、1アドレスが最大21ビットのデータを格納しなければならない。したがって、システム制御部50が21ビット以上のデータを一度に扱えない場合(例えば16ビットCPUである場合)は、Y成分を256階調で表現する1個のヒストグラムを保持するために8ビットよりも多くのアドレス空間が必要となる。
In the description of the present embodiment, the capacity of the
[第2の実施形態]
第1の実施形態では、デジタルカメラ100は、画質が必ず所定の水準以上となるまで圧縮パラメータの変更及び圧縮処理を繰り返した。これに対し、第2の実施形態では、画質が所定の水準未満の場合に、圧縮パラメータの変更及び再度の圧縮処理を行うか否かをユーザが選択可能なようにデジタルカメラ100を構成する。
[Second Embodiment]
In the first embodiment, the
これにより、ユーザが画質よりも処理速度を優先したい場合に、圧縮パラメータの変更及び圧縮処理の繰り返しに伴う処理速度の低下を抑制することができる。 Thereby, when the user wants to prioritize the processing speed over the image quality, it is possible to suppress a decrease in the processing speed due to the compression parameter change and the compression process being repeated.
なお、本実施形態において、デジタルカメラ100の構成(ヒストグラム取得回路28の構成を含む)は第1の実施形態と同様でよいため、その説明を省略する。 In the present embodiment, the configuration of the digital camera 100 (including the configuration of the histogram acquisition circuit 28) may be the same as that of the first embodiment, and the description thereof is omitted.
図6は、第2の実施形態における、デジタルカメラ100による撮像・記録処理の流れを示すフローチャートである。図5と同一の処理を行うステップには同一の符号を付し、説明を省略する。
FIG. 6 is a flowchart illustrating the flow of the imaging / recording process performed by the
ステップS601は、ステップS512において画質が所定の水準以上ではないと判定された場合に実行される。ステップS601で、システム制御部50は、画像表示部32に画質が所定の水準未満である旨の警告を表示する。システム制御部50はまた、圧縮パラメータを変更して再度圧縮処理を行うか否かをユーザに選択させるメニュー画面を画像表示部32に表示する。
Step S601 is executed when it is determined in step S512 that the image quality is not higher than a predetermined level. In step S601, the
ステップS602で、システム制御部50は、セレクトボタン48などを介してユーザから再度圧縮を行う旨の指示を受けたか否かを判定する。再度圧縮を行う旨の指示を受けた場合はステップS603に進み、再度圧縮しない旨の指示を受けた場合はステップS514に進む。
In step S602, the
ステップS603で、システム制御部50は、圧縮パラメータの設定変更画面を画像表示部32に表示する。このとき、システム制御部50は、ステップS510で生成されたヒストグラムや、このヒストグラムから得られる隣接度数変化の割合を示すグラフを、画像表示部32に表示してもよい。
In step S <b> 603, the
ステップS604で、システム制御部50は、セレクトボタン48などを介してユーザから変更後の圧縮パラメータを取得し、メモリ52などに記録する。次いで、ステップS505に戻り、同様の処理を繰り返す。
In step S604, the
なお、ステップS603及びS604の処理は、ステップS513と同様、ユーザの指示を受けることなく、システム制御部50が量子化テーブルの値を少しずつ小さくするようにしてもよい。
In steps S603 and S604, the
<第2の実施形態のまとめ>
以上説明したように、本実施形態によれば、画質が所定の水準未満の場合であっても、ユーザの指示によっては、デジタルカメラ100は圧縮パラメータの変更及び再度の圧縮処理を行わない。
<Summary of Second Embodiment>
As described above, according to the present embodiment, even if the image quality is less than a predetermined level, the
これにより、ユーザが画質よりも処理速度を優先したい場合に、圧縮パラメータの変更及び圧縮処理の繰り返しに伴う処理速度の低下を抑制することができる。 Thereby, when the user wants to prioritize the processing speed over the image quality, it is possible to suppress a decrease in the processing speed due to the compression parameter change and the compression process being repeated.
[その他の実施形態]
上述した各実施の形態の処理は、各機能を具現化したソフトウェアのプログラムコードを記録した記憶媒体をシステム或は装置に提供してもよい。そして、そのシステム或は装置のコンピュータ(又はCPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行することによって、前述した実施形態の機能を実現することができる。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施形態の機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。このようなプログラムコードを供給するための記憶媒体としては、例えば、フロッピィ(登録商標)ディスク、ハードディスク、光ディスク、光磁気ディスクなどを用いることができる。或いは、CD−ROM、CD−R、磁気テープ、不揮発性のメモリカード、ROMなどを用いることもできる。
[Other Embodiments]
The processing of each embodiment described above may provide a system or apparatus with a storage medium storing software program codes embodying each function. The functions of the above-described embodiments can be realized by the computer (or CPU or MPU) of the system or apparatus reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the storage medium storing the program code constitutes the present invention. As a storage medium for supplying such a program code, for example, a floppy (registered trademark) disk, a hard disk, an optical disk, a magneto-optical disk, or the like can be used. Alternatively, a CD-ROM, CD-R, magnetic tape, nonvolatile memory card, ROM, or the like can be used.
また、コンピュータが読み出したプログラムコードを実行することにより、前述した各実施の形態の機能が実現されるだけではない。そのプログラムコードの指示に基づき、コンピュータ上で稼動しているOS(オペレーティングシステム)などが実際の処理の一部又は全部を行い、その処理によって前述した各実施の形態の機能が実現される場合も含まれている。 The functions of the above-described embodiments are not only realized by executing the program code read by the computer. In some cases, an OS (operating system) running on the computer performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. include.
さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書きこまれてもよい。その後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部又は全部を行い、その処理によって前述した各実施の形態の機能が実現される場合も含むものである。 Further, the program code read from the storage medium may be written in a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer. After that, the CPU of the function expansion board or function expansion unit performs part or all of the actual processing based on the instruction of the program code, and the functions of the above-described embodiments are realized by the processing. Is also included.
28 ヒストグラム取得回路
100 デジタルカメラ
28
Claims (11)
前記第2の画像データを伸長して第3の画像データを生成する伸長手段と、
前記第3の画像データから、輝度成分及び複数の色成分のうち少なくともいずれか1成分に対応するヒストグラムを生成する生成手段と、
前記生成手段によりヒストグラムが生成されると、当該ヒストグラムの各階級について隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更する変更手段と、
を備え、
前記変更手段により前記圧縮率が変更された場合、変更された圧縮率での前記圧縮手段による非可逆圧縮、当該非可逆圧縮により生成された画像データの前記伸長手段による伸長、及び当該伸長により生成された画像データに関する前記生成手段によるヒストグラムの生成を再度行うことを特徴とする画像処理装置。 Compression means for irreversibly compressing the first image data at a predetermined compression rate based on the compression parameter to generate the second image data;
Decompression means for decompressing the second image data to generate third image data;
Generating means for generating a histogram corresponding to at least one of a luminance component and a plurality of color components from the third image data;
When the histogram is generated by the generating means, the compression rate is calculated when the number of classes whose frequency change rate from an adjacent class exceeds a predetermined ratio is greater than a predetermined number for each class of the histogram. Change means to change
With
When the compression rate is changed by the changing unit, the lossy compression by the compression unit at the changed compression rate, the decompression by the decompression unit of the image data generated by the lossy compression, and the decompression An image processing apparatus characterized in that the generation of the generated image data by the generation means is performed again .
前記変更手段は、前記生成手段が生成したヒストグラムのうちの少なくとも1つについて、隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更することを特徴とする請求項1に記載の画像処理装置。 The changing means, when at least one of the histograms generated by the generating means, when the number of classes whose frequency change rate from the adjacent class exceeds a predetermined ratio is greater than a predetermined number, The image processing apparatus according to claim 1, wherein the compression rate is changed.
前記変更手段は、前記生成手段が生成したヒストグラムの全てについて、隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更することを特徴とする請求項1に記載の画像処理装置。 The changing means, for all of the histograms generated by the generating means, when the number of classes whose frequency change rate from an adjacent class exceeds a predetermined ratio is greater than a predetermined number, The image processing apparatus according to claim 1, wherein the image processing apparatus is changed.
前記第2の画像データを伸長して第3の画像データを生成する伸長工程と、
前記第3の画像データから、輝度成分及び複数の色成分のうち少なくともいずれか1成分に対応するヒストグラムを生成する生成工程と、
前記生成工程によりヒストグラムが生成されると、当該ヒストグラムの各階級について隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更する変更工程と、
を備え、
前記変更工程により前記圧縮率が変更された場合、変更された圧縮率での前記圧縮工程による非可逆圧縮、当該非可逆圧縮により生成された画像データの前記伸長工程による伸長、及び当該伸長により生成された画像データに関する前記生成工程によるヒストグラムの生成を再度行うことを特徴とする画像処理方法。 A compression step of irreversibly compressing the first image data at a predetermined compression rate based on the compression parameter to generate the second image data;
A decompression step of decompressing the second image data to generate third image data;
Generating a histogram corresponding to at least one of a luminance component and a plurality of color components from the third image data;
When a histogram is generated by the generation step, the compression rate is calculated when the number of classes whose frequency change rate from an adjacent class exceeds a predetermined ratio is greater than a predetermined number for each class of the histogram. Change process to change,
With
When the compression rate is changed by the changing step, the lossy compression by the compression step at the changed compression rate, the decompression by the decompression step of the image data generated by the lossy compression, and the decompression An image processing method, characterized in that a histogram is generated again by the generating step for the processed image data .
圧縮パラメータに基づいて所定の圧縮率で第1の画像データを非可逆圧縮して第2の画像データを生成する圧縮工程と、
前記第2の画像データを伸長して第3の画像データを生成する伸長工程と、
前記第3の画像データから、輝度成分及び複数の色成分のうち少なくともいずれか1成分に対応するヒストグラムを生成する生成工程と、
前記生成工程によりヒストグラムが生成されると、当該ヒストグラムの各階級について隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更する変更工程と、
を備え、
前記変更工程により前記圧縮率が変更された場合、変更された圧縮率での前記圧縮工程による非可逆圧縮、当該非可逆圧縮により生成された画像データの前記伸長工程による伸長、及び当該伸長により生成された画像データに関する前記生成工程によるヒストグラムの生成を再度行うことを特徴とする画像処理方法を実行させるためのプログラム。 On the computer,
A compression step of irreversibly compressing the first image data at a predetermined compression rate based on the compression parameter to generate the second image data;
A decompression step of decompressing the second image data to generate third image data;
Generating a histogram corresponding to at least one of a luminance component and a plurality of color components from the third image data;
When a histogram is generated by the generation step, the compression rate is calculated when the number of classes whose frequency change rate from an adjacent class exceeds a predetermined ratio is greater than a predetermined number for each class of the histogram. Change process to change,
With
When the compression rate is changed by the changing step, the lossy compression by the compression step at the changed compression rate, the decompression by the decompression step of the image data generated by the lossy compression, and the decompression A program for executing an image processing method, wherein the generation of a histogram in the generation step relating to the image data is performed again .
圧縮パラメータに基づいて所定の圧縮率で第1の画像データを非可逆圧縮して第2の画像データを生成する圧縮工程と、
前記第2の画像データを伸長して第3の画像データを生成する伸長工程と、
前記第3の画像データから、輝度成分及び複数の色成分のうち少なくともいずれか1成分に対応するヒストグラムを生成する生成工程と、
前記生成工程によりヒストグラムが生成されると、当該ヒストグラムの各階級について隣接する階級からの度数の変化の割合が所定の割合を超える階級の数が所定の数より大である場合に、前記圧縮率を変更する変更工程と、
を備え、
前記変更工程により前記圧縮率が変更された場合、変更された圧縮率での前記圧縮工程による非可逆圧縮、当該非可逆圧縮により生成された画像データの前記伸長工程による伸長、及び当該伸長により生成された画像データに関する前記生成工程によるヒストグラムの生成を再度行うことを特徴とする画像処理方法を実行させるためのプログラムを記録したコンピュータ読み取り可能な記憶媒体。 On the computer,
A compression step of irreversibly compressing the first image data at a predetermined compression rate based on the compression parameter to generate the second image data;
A decompression step of decompressing the second image data to generate third image data;
Generating a histogram corresponding to at least one of a luminance component and a plurality of color components from the third image data;
When a histogram is generated by the generation step, the compression rate is calculated when the number of classes whose frequency change rate from an adjacent class exceeds a predetermined ratio is greater than a predetermined number for each class of the histogram. Change process to change,
With
When the compression rate is changed by the changing step, the lossy compression by the compression step at the changed compression rate, the decompression by the decompression step of the image data generated by the lossy compression, and the decompression The computer-readable storage medium which recorded the program for performing the image processing method characterized by performing again the production | generation of the histogram by the said production | generation process regarding the performed image data .
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005302160A JP4701065B2 (en) | 2005-10-17 | 2005-10-17 | Image processing apparatus and image processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005302160A JP4701065B2 (en) | 2005-10-17 | 2005-10-17 | Image processing apparatus and image processing method |
Publications (3)
Publication Number | Publication Date |
---|---|
JP2007110652A JP2007110652A (en) | 2007-04-26 |
JP2007110652A5 JP2007110652A5 (en) | 2008-11-27 |
JP4701065B2 true JP4701065B2 (en) | 2011-06-15 |
Family
ID=38036122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005302160A Expired - Fee Related JP4701065B2 (en) | 2005-10-17 | 2005-10-17 | Image processing apparatus and image processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4701065B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5179306B2 (en) * | 2008-09-22 | 2013-04-10 | Kddi株式会社 | Moving picture coding method, moving picture coding apparatus, and moving picture coding program |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04175067A (en) * | 1990-11-08 | 1992-06-23 | Toshiba Corp | Image compression/restoration device |
JPH08129831A (en) * | 1994-11-01 | 1996-05-21 | Sony Corp | Device and method for coding |
-
2005
- 2005-10-17 JP JP2005302160A patent/JP4701065B2/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH04175067A (en) * | 1990-11-08 | 1992-06-23 | Toshiba Corp | Image compression/restoration device |
JPH08129831A (en) * | 1994-11-01 | 1996-05-21 | Sony Corp | Device and method for coding |
Also Published As
Publication number | Publication date |
---|---|
JP2007110652A (en) | 2007-04-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4466261B2 (en) | Imaging apparatus, brightness correction method, and program | |
EP1715671A1 (en) | Image sensing apparatus and white balance correction method | |
JP2007097145A (en) | Image coding device and image coding method | |
JP4359773B2 (en) | Image compression processing apparatus, image compression processing method, and image compression processing program | |
JP2010193007A (en) | Imaging apparatus | |
US20170359471A1 (en) | Imaging apparatus | |
JP2010063036A (en) | Imaging apparatus and image display method | |
JP4560422B2 (en) | Imaging apparatus and control method thereof | |
JP2008109305A (en) | Image processing device, and control method of image processing device | |
JP2015195582A (en) | Image processing device, control method thereof, imaging apparatus, control method thereof, and recording medium | |
JP4769567B2 (en) | IMAGING DEVICE, IMAGING DEVICE CONTROL METHOD, COMPUTER PROGRAM, AND STORAGE MEDIUM | |
US10341601B2 (en) | Image processing apparatus, imaging apparatus, and image processing method | |
CN107979718B (en) | Image processing apparatus, image processing method, and storage medium | |
US6876768B1 (en) | Image processing apparatus and method, and storage medium | |
JP2016019161A (en) | Imaging device | |
JP4366485B2 (en) | Imaging apparatus, image processing method, and program | |
JP4701065B2 (en) | Image processing apparatus and image processing method | |
US7756331B2 (en) | Image processing apparatus and method for displaying images and corresponding histograms | |
JP6741532B2 (en) | Imaging device and recording method | |
US8493462B2 (en) | Image processing apparatus, photographing apparatus and control method for compressing images | |
JP4401882B2 (en) | Image processing apparatus, image processing method, program, and storage medium | |
JP2004118018A (en) | On-screen display device and digital camera | |
JP2016052081A (en) | Imaging apparatus, and method and program for storing image | |
JP2006033088A (en) | Image processing apparatus and method, imaging apparatus, program, and storage medium | |
JP5610860B2 (en) | Imaging apparatus and information processing apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20081010 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20081010 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20101224 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110210 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20110228 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20110307 |
|
LAPS | Cancellation because of no payment of annual fees |